Commit d307bb9c authored by Malthe Borch's avatar Malthe Borch Committed by Tres Seaver

Ensure that interaction ends, once begun.

Wrap in try-finally.

Cherry-pick c73dfcd1 from master.
parent a2e8e90a
......@@ -167,47 +167,48 @@ def publish(request, module_name,
notify(PubStart(request))
newInteraction()
request.processInputs()
response = request.response
if bobo_after is not None:
response.after_list += (bobo_after,)
if debug_mode:
response.debug_mode = debug_mode
if realm and not request.get('REMOTE_USER', None):
response.realm = realm
if bobo_before is not None:
bobo_before()
# Get the path list.
# According to RFC1738 a trailing space in the path is valid.
path = request.get('PATH_INFO')
request['PARENTS'] = [object]
object = request.traverse(path, validated_hook=validated_hook)
notify(PubAfterTraversal(request))
if transactions_manager:
transactions_manager.recordMetaData(object, request)
result = mapply(object,
request.args,
request,
call_object,
1,
missing_name,
dont_publish_class,
request,
bind=1,
)
if result is not response:
response.setBody(result)
endInteraction()
try:
request.processInputs()
response = request.response
if bobo_after is not None:
response.after_list += (bobo_after,)
if debug_mode:
response.debug_mode = debug_mode
if realm and not request.get('REMOTE_USER', None):
response.realm = realm
if bobo_before is not None:
bobo_before()
# Get the path list.
# According to RFC1738 a trailing space in the path is valid.
path = request.get('PATH_INFO')
request['PARENTS'] = [object]
object = request.traverse(path, validated_hook=validated_hook)
notify(PubAfterTraversal(request))
if transactions_manager:
transactions_manager.recordMetaData(object, request)
result = mapply(object,
request.args,
request,
call_object,
1,
missing_name,
dont_publish_class,
request,
bind=1,
)
if result is not response:
response.setBody(result)
finally:
endInteraction()
notify(PubBeforeCommit(request))
return response
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment