Skip to content
Snippets Groups Projects

Resolve "AttributeError at /about/: 'AnonymousUser' object has no attribute 'person'"

3 files
+ 1
19
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -321,11 +321,6 @@ def generate_random_code(length, packet_size) -> str:
return get_random_string(packet_size * length).lower()
def unread_notifications_badge(request: HttpRequest) -> int:
"""Generate badge content with the number of unread notifications."""
return request.user.person.unread_notifications_count
def monkey_patch() -> None: # noqa
"""Monkey-patch dependencies for special behaviour."""
# Unwrap promises in JSON serializer instead of stringifying
Loading