socket: Don't throw traceback when sessions are expired.

(imported from commit 16c876b5bbd0c6ecd5ef48369a7f71ca74d1183f)
This commit is contained in:
Tim Abbott
2013-12-18 15:28:50 -05:00
parent e76eac49cb
commit a70072f5cf

View File

@@ -38,7 +38,7 @@ def get_user_profile(session_id):
try: try:
return UserProfile.objects.get(pk=session_store['_auth_user_id']) return UserProfile.objects.get(pk=session_store['_auth_user_id'])
except UserProfile.DoesNotExist: except (UserProfile.DoesNotExist, KeyError):
return None return None
connections = dict() connections = dict()