Skip to content
Snippets Groups Projects
Commit 25fb8ef1 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch...

Merge branch '683-attributeerror-at-about-anonymoususer-object-has-no-attribute-person' into 'master'

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

Closes #683

See merge request !1006
parents 51f09e95 083adaaf
No related branches found
No related tags found
1 merge request!1006Resolve "AttributeError at /about/: 'AnonymousUser' object has no attribute 'person'"
Pipeline #65041 passed with warnings
......@@ -25,6 +25,7 @@ Fixed
* The icons in the account menu were still the old ones.
* Due to a merge error, the once removed account menu in the sidenav appeared again.
* Scheduled notifications were shown on dashboard before time.
* Remove broken notifications menu item in favor of item next to account menu.
Changed
~~~~~~~
......
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from .util.core_helpers import unread_notifications_badge
MENUS = {
"NAV_MENU_CORE": [
{
......@@ -37,18 +35,6 @@ MENUS = {
("aleksis.core.util.predicates.permission_validator", "core.view_dashboard_rule")
],
},
{
"name": _("Notifications"),
"url": "notifications",
"svg_icon": "mdi:bell-outline",
"badge": unread_notifications_badge,
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"core.view_notifications_rule",
),
],
},
{
"name": _("Admin"),
"url": "#",
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment