From 083adaaf9bd6e39f8f6bcd5b74586aa18eafdb25 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Thu, 31 Mar 2022 12:29:29 +0200
Subject: [PATCH] Remove broken notifications menu item

---
 CHANGELOG.rst                     |  1 +
 aleksis/core/menus.py             | 14 --------------
 aleksis/core/util/core_helpers.py |  5 -----
 3 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index c92ee0513..c2a9e2cfa 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -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
 ~~~~~~~
diff --git a/aleksis/core/menus.py b/aleksis/core/menus.py
index 58ffe5bcc..49ddd4af7 100644
--- a/aleksis/core/menus.py
+++ b/aleksis/core/menus.py
@@ -1,8 +1,6 @@
 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": "#",
diff --git a/aleksis/core/util/core_helpers.py b/aleksis/core/util/core_helpers.py
index 6c9e0f10f..ffdba5f45 100644
--- a/aleksis/core/util/core_helpers.py
+++ b/aleksis/core/util/core_helpers.py
@@ -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
-- 
GitLab