Skip to content

Commit

Permalink
revoke #185 (fixed duplicate exec of meta-cmds)
Browse files Browse the repository at this point in the history
Ref: 3481028
  • Loading branch information
drfho committed Sep 28, 2023
1 parent d80fd21 commit 5077dd5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Products/zms/zmsobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,24 +1239,26 @@ def manage_executeMetacmd(self, lang, REQUEST, RESPONSE=None):
# METACMD
metaCmd = self.getMetaCmd(id)
if metaCmd is not None:
# Execute directly.
# Execute metacmd.
ob = zopeutil.getObject(self, id)
if not metaCmd['id'].startswith('manage_tab_') and metaCmd.get('execution', 0) == 1:
value = zopeutil.callObject(ob, zmscontext=self)
value = zopeutil.callObject(ob, zmscontext=self)
# Proceed with generating message for executed metacmd.
if not metaCmd['id'].startswith('manage_tab_') and bool(metaCmd.get('execution', 0)) == True:
if isinstance(value, str):
message = value
elif isinstance(value, tuple):
target = value[0]
message = value[1]
# Execute redirect.
# Proceed with redirecting to tab view.
else:
loc = '%s/%s?lang=%s'%(target.absolute_url(),metaCmd['id'],lang)
status = 302
if REQUEST.method == 'GET':
status = 201 # Turbolinks
RESPONSE.setHeader('Location',loc)
RESPONSE.setHeader('Turbolinks-Location',loc)
return RESPONSE.redirect(loc,status=status)
RESPONSE.redirect(loc,status=status)
return value

# Return with message.
message = standard.url_quote(message)
Expand Down

0 comments on commit 5077dd5

Please sign in to comment.