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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
4355b153
Commit
4355b153
authored
Jan 21, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: fixup error displayed when the delete transition can not be triggered
parent
a8aa18b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
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
+9
-7
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
View file @
4355b153
...
...
@@ -5,7 +5,7 @@ The code is a modified version of Folder_delete. We split into two files not to
further complicate the mentioned script.
"""
from
ZODB.POSException
import
ConflictError
from
Products.ERP5Type.Errors
import
UnsupportedWorkflowMethod
portal
=
context
.
getPortalObject
()
translate
=
portal
.
Base_translateString
...
...
@@ -31,13 +31,15 @@ if context.isDeletable(check_relation=True):
"portal_status_message"
:
translate
(
"Document deleted"
)
})
except
ConflictError
:
raise
except
Exception
:
# XXX Catch-them-all expression is never a good idea
except
UnsupportedWorkflowMethod
:
pass
request
=
portal
.
REQUEST
request
.
RESPONSE
.
setStatus
(
400
)
form
=
getattr
(
context
,
form_id
)
return
context
.
ERP5Document_getHateoas
(
form
=
form
,
REQUEST
=
request
,
mode
=
'form'
)
return
context
.
Base_renderForm
(
dialog_id
,
keep_items
=
{
'portal_status_message'
:
translate
(
"You are not authorised to delete the document"
),
'portal_status_level'
:
'warning'
}
)
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