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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
8612f137
Commit
8612f137
authored
Jul 12, 2024
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_api_style: WIP abort transaction
parent
35a1119d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
bt5/erp5_api_style/DocumentTemplateItem/portal_components/document.erp5.jIOWebSection.py
...lateItem/portal_components/document.erp5.jIOWebSection.py
+14
-3
bt5/erp5_api_style/DocumentTemplateItem/portal_components/document.erp5.jIOWebSection.xml
...ateItem/portal_components/document.erp5.jIOWebSection.xml
+3
-1
No files found.
bt5/erp5_api_style/DocumentTemplateItem/portal_components/document.erp5.jIOWebSection.py
View file @
8612f137
...
...
@@ -32,6 +32,8 @@ from Acquisition import aq_inner
from
zExceptions
import
NotFound
,
Unauthorized
from
Products.ERP5Type
import
Permissions
import
transaction
from
erp5.component.mixin.DocumentExtensibleTraversableMixin
import
DocumentExtensibleTraversableMixin
from
erp5.component.document.WebSection
import
WebSection
...
...
@@ -97,8 +99,17 @@ class jIOMethod(object):
# Avoid information leak when Unauthorized
del
error_context
[
"error_message"
]
# Skin used to allow replacement and because Manager proxy role is needed
self
.
web_section
.
ERP5Site_logApiErrorAndReturn
(
**
error_context
)
transaction
.
abort
()
transaction
.
begin
()
try
:
# Skin used to allow replacement and because Manager proxy role is needed
self
.
web_section
.
ERP5Site_logApiErrorAndReturn
(
**
error_context
)
except
:
transaction
.
abort
()
return
transaction
.
commit
()
class
jIOWebSection
(
WebSection
):
portal_type
=
"jIO Web Section"
...
...
@@ -121,7 +132,7 @@ class jIOWebSection(WebSection):
section
=
section
.
aq_parent
return
default
security
.
declareProtected
(
Permissions
.
View
,
"_bobo_traverse__"
)
security
.
declareProtected
(
Permissions
.
View
,
"_
_
bobo_traverse__"
)
def
__bobo_traverse__
(
self
,
request
,
name
):
if
name
in
ALLOWED_MODES
:
return
jIOMethod
(
name
,
self
)
...
...
bt5/erp5_api_style/DocumentTemplateItem/portal_components/document.erp5.jIOWebSection.xml
View file @
8612f137
...
...
@@ -45,7 +45,9 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
W:108, 6: No exception type(s) specified (bare-except)
</string>
</tuple>
</value>
</item>
<item>
...
...
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