Skip to content

Commit 382187c

Browse files
committed
Corrected wrapping in channels/auth.py.
1 parent 353837d commit 382187c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

channels/auth.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def get_user(scope):
2323
Return the user model instance associated with the given scope.
2424
If no user is retrieved, return an instance of `AnonymousUser`.
2525
"""
26-
# postpone model import to avoid ImproperlyConfigured error before Django setup is complete.
26+
# postpone model import to avoid ImproperlyConfigured error before Django
27+
# setup is complete.
2728
from django.contrib.auth.models import AnonymousUser
2829

2930
if "session" not in scope:
@@ -59,7 +60,8 @@ def login(scope, user, backend=None):
5960
"""
6061
Persist a user id and a backend in the request.
6162
This way a user doesn't have to re-authenticate on every request.
62-
Note that data set during the anonymous session is retained when the user logs in.
63+
Note that data set during the anonymous session is retained when the user
64+
logs in.
6365
"""
6466
if "session" not in scope:
6567
raise ValueError(
@@ -112,9 +114,11 @@ def login(scope, user, backend=None):
112114
@database_sync_to_async
113115
def logout(scope):
114116
"""
115-
Remove the authenticated user's ID from the request and flush their session data.
117+
Remove the authenticated user's ID from the request and flush their session
118+
data.
116119
"""
117-
# postpone model import to avoid ImproperlyConfigured error before Django setup is complete.
120+
# postpone model import to avoid ImproperlyConfigured error before Django
121+
# setup is complete.
118122
from django.contrib.auth.models import AnonymousUser
119123

120124
if "session" not in scope:

0 commit comments

Comments
 (0)