Skip to content

Commit

Permalink
Revert "Provide a REQUEST in an async call."
Browse files Browse the repository at this point in the history
This reverts commit 355d10e.
I don't want this to be part of the current pull request.
  • Loading branch information
jean committed Apr 27, 2012
1 parent 355d10e commit d1db66e
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/plone/app/async/service.py
Expand Up @@ -58,27 +58,7 @@ def _executeAsUser(context_path, portal_path, uf_path, user_id, func, *args, **k
if context is None:
raise BadRequest(
'Context path %s not found' % '/'.join(context_path))

# Create a request to work with
import sys
from ZPublisher.HTTPResponse import HTTPResponse
from ZPublisher.HTTPRequest import HTTPRequest
response = HTTPResponse(stdout=sys.stdout)
env = {'SERVER_NAME':'fake_server',
'SERVER_PORT':'80',
'REQUEST_METHOD':'GET'}
request = HTTPRequest(sys.stdin, env, response)

# Set values from original request
original_request = kwargs.get('original_request')
if original_request:
for k,v in original_request.items():
request.set(k, v)
context.REQUEST = request

result = func(context, *args, **kwargs)

del context.REQUEST #Avoid "can't pickle file objects"
transaction.commit()
except:
transaction.abort()
Expand Down

0 comments on commit d1db66e

Please sign in to comment.