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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
d67dae6d
Commit
d67dae6d
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
Hide 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 @
d67dae6d
...
@@ -5,7 +5,7 @@ The code is a modified version of Folder_delete. We split into two files not to
...
@@ -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.
further complicate the mentioned script.
"""
"""
from
ZODB.POSException
import
ConflictError
from
Products.ERP5Type.Errors
import
UnsupportedWorkflowMethod
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
translate
=
portal
.
Base_translateString
translate
=
portal
.
Base_translateString
...
@@ -31,13 +31,15 @@ if context.isDeletable(check_relation=True):
...
@@ -31,13 +31,15 @@ if context.isDeletable(check_relation=True):
"portal_status_message"
:
translate
(
"Document deleted"
)
"portal_status_message"
:
translate
(
"Document deleted"
)
})
})
except
ConflictError
:
except
UnsupportedWorkflowMethod
:
raise
except
Exception
:
# XXX Catch-them-all expression is never a good idea
pass
pass
request
=
portal
.
REQUEST
request
=
portal
.
REQUEST
request
.
RESPONSE
.
setStatus
(
400
)
request
.
RESPONSE
.
setStatus
(
400
)
form
=
getattr
(
context
,
form_id
)
return
context
.
Base_renderForm
(
return
context
.
ERP5Document_getHateoas
(
form
=
form
,
REQUEST
=
request
,
mode
=
'form'
)
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