We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ab6823 commit 49e913aCopy full SHA for 49e913a
authors.rst
@@ -1,2 +1,5 @@
1
Author:
2
* Selwin Ong
3
+
4
+Contributors:
5
+* Gilang Chandrasa
cached_auth/__init__.py
@@ -43,7 +43,8 @@ def get_cached_user(request):
43
if profile_model:
44
try:
45
user.get_profile()
46
- except profile_model.DoesNotExist:
+ # Handle exception for user with no profile and AnonymousUser
47
+ except (profile_model.DoesNotExist, AttributeError):
48
pass
49
cache.set(key, user)
50
request._cached_user = user
0 commit comments