Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laurent S
erp5
Commits
a9c3f613
Commit
a9c3f613
authored
Mar 18, 2016
by
Xiaowu Zhang
Committed by
Julien Muchembled
Mar 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: ConflictError must never be catched
parent
a2122c35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
...tem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
+15
-22
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
View file @
a9c3f613
...
...
@@ -6,30 +6,23 @@ intended to make code easy understanding
"""
portal
=
context
.
getPortalObject
()
request
=
container
.
REQUEST
def
errorHandler
():
request
.
RESPONSE
.
setStatus
(
400
)
form
=
getattr
(
context
,
form_id
)
return
context
.
ERP5Document_getHateoas
(
form
=
form
,
REQUEST
=
request
,
mode
=
'form'
)
if
context
.
isDeletable
(
check_relation
=
True
):
if
portal
.
portal_workflow
.
isTransitionPossible
(
context
,
'delete'
):
parent
=
context
.
getParentValue
()
try
:
if
parent
.
portal_type
!=
'Preference'
and
\
portal
.
portal_workflow
.
isTransitionPossible
(
context
,
'delete'
):
portal
.
portal_workflow
.
doActionFor
(
context
,
'delete_action'
)
except
ConflictError
:
return
errorHandler
()
except
Exception
:
pass
else
:
try
:
context
.
getParentValue
().
manage_delObjects
(
ids
=
[
context
.
getId
()])
parent
.
manage_delObjects
(
ids
=
[
context
.
getId
()])
return
except
ConflictError
:
return
errorHandler
()
raise
except
Exception
:
pass
else
:
return
errorHandler
()
request
=
portal
.
REQUEST
request
.
RESPONSE
.
setStatus
(
400
)
form
=
getattr
(
context
,
form_id
)
return
context
.
ERP5Document_getHateoas
(
form
=
form
,
REQUEST
=
request
,
mode
=
'form'
)
Write
Preview
Markdown
is supported
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