mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Fix missing import
This commit is contained in:
parent
773f1332ee
commit
6fe841337d
|
@ -60,6 +60,8 @@ def http_session_user(func):
|
|||
if not hasattr(message, "http_session"):
|
||||
raise ValueError("Did not see a http session to get auth from")
|
||||
if message.http_session is None:
|
||||
# Inner import to avoid reaching into models before load complete
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
message.user = AnonymousUser()
|
||||
# Otherwise, be a bit naughty and make a fake Request with just
|
||||
# a "session" attribute (later on, perhaps refactor contrib.auth to
|
||||
|
|
Loading…
Reference in New Issue
Block a user