Merge pull request #1421 from normanjaeckel/FixChatbox
Fixed bug in chatbox.
This commit is contained in:
commit
fb0600809c
@ -25,13 +25,13 @@ class ChatboxSocketHandler(SockJSConnection):
|
|||||||
engine = import_module(settings.SESSION_ENGINE)
|
engine = import_module(settings.SESSION_ENGINE)
|
||||||
try:
|
try:
|
||||||
session_key = info.get_cookie(settings.SESSION_COOKIE_NAME).value
|
session_key = info.get_cookie(settings.SESSION_COOKIE_NAME).value
|
||||||
session = engine.SessionStore(session_key)
|
session_store = engine.SessionStore(session_key)
|
||||||
pk = session.get_decoded().get('_auth_user_id')
|
pk = session_store.get('_auth_user_id')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.user = User.objects.get(pk)
|
self.user = User.objects.get(pk=pk)
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user