Commit c73dfcd1 authored by Malthe Borch's avatar Malthe Borch

An interaction must end, once begun. Wrap in try-finally.

parent 3858283d
...@@ -167,47 +167,48 @@ def publish(request, module_name, ...@@ -167,47 +167,48 @@ def publish(request, module_name,
notify(PubStart(request)) notify(PubStart(request))
newInteraction() newInteraction()
request.processInputs() try:
response = request.response request.processInputs()
response = request.response
if bobo_after is not None:
response.after_list += (bobo_after,) if bobo_after is not None:
response.after_list += (bobo_after,)
if debug_mode:
response.debug_mode = debug_mode if debug_mode:
response.debug_mode = debug_mode
if realm and not request.get('REMOTE_USER', None):
response.realm = realm if realm and not request.get('REMOTE_USER', None):
response.realm = realm
if bobo_before is not None:
bobo_before() if bobo_before is not None:
bobo_before()
# Get the path list.
# According to RFC1738 a trailing space in the path is valid. # Get the path list.
path = request.get('PATH_INFO') # 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) request['PARENTS'] = [object]
notify(PubAfterTraversal(request)) object = request.traverse(path, validated_hook=validated_hook)
notify(PubAfterTraversal(request))
if transactions_manager:
transactions_manager.recordMetaData(object, request) if transactions_manager:
transactions_manager.recordMetaData(object, request)
result = mapply(object,
request.args, result = mapply(object,
request, request.args,
call_object, request,
1, call_object,
missing_name, 1,
dont_publish_class, missing_name,
request, dont_publish_class,
bind=1, request,
) bind=1,
)
if result is not response:
response.setBody(result) if result is not response:
response.setBody(result)
endInteraction() finally:
endInteraction()
notify(PubBeforeCommit(request)) notify(PubBeforeCommit(request))
return response 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