Commit 56877d18 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[ui] Fix case of inlined-edition-form

Crash with KeyError before this patch
parent 20e53a5917e4
......@@ -92,13 +92,16 @@ for etype in ('SEDABinaryDataObject', 'SEDAPhysicalDataObject'):
def uri_cardinality_vocabulary(form, field):
req = form._cw
try:
# inlined creation form
parent_type = json.loads(req.form['arg'][1])
except KeyError:
# edition through reledit
parent_eid = req.form['eid']
parent_type = req.describe(int(parent_eid))[0]
if form.edited_entity.has_eid():
parent_type = form.edited_entity.cw_adapt_to('IContained').parent.cw_etype
else:
try:
# inlined creation form
parent_type = json.loads(req.form['arg'][1])
except KeyError:
# edition through reledit
parent_eid = req.form['eid']
parent_type = req.describe(int(parent_eid))[0]
if parent_type in ('SEDABinaryDataObject', 'SEDAAltBinaryDataObjectAttachment'):
return [u'1']
return [u'0..1', u'1']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment