Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
88a398308bfb
Commit
56877d18
authored
Jun 15, 2016
by
Sylvain Thénault
Browse files
[ui] Fix case of inlined-edition-form
Crash with KeyError before this patch
parent
20e53a5917e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
views/dataobject.py
View file @
88a39830
...
...
@@ -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'
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment