hooks: inject request.user for proper url generation in async methods.
- this is just a temporary injection as it's later properly bootstrapped in the async celery process.
This commit is contained in:
parent
d662f70d95
commit
b4cc6e507a
1 changed files with 7 additions and 0 deletions
|
|
@ -212,7 +212,14 @@ class Hooks(object):
|
|||
extras = AttributeDict(extras)
|
||||
server_url = extras['server_url']
|
||||
request = bootstrap_request(application_url=server_url)
|
||||
|
||||
bootstrap_config(request) # inject routes and other interfaces
|
||||
|
||||
# inject the user for usage in hooks
|
||||
request.user = AttributeDict({'username': extras.username,
|
||||
'ip_addr': extras.ip,
|
||||
'user_id': extras.user_id})
|
||||
|
||||
extras.request = request
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue