From afb6040e9a6298d3da4cd6995c3a4d396820f9e9 Mon Sep 17 00:00:00 2001 From: Jiro Ghianni Date: Tue, 17 Sep 2024 16:54:39 +0200 Subject: [PATCH] [#2760] Corrected sidebar for when notifications are off --- src/open_inwoner/accounts/views/profile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/open_inwoner/accounts/views/profile.py b/src/open_inwoner/accounts/views/profile.py index 9ee1841790..c6ff18478a 100644 --- a/src/open_inwoner/accounts/views/profile.py +++ b/src/open_inwoner/accounts/views/profile.py @@ -98,16 +98,20 @@ def stringify( return (string_func(item) for item in items) def get_context_data(self, **kwargs): + config = SiteConfiguration.get_solo() context = super().get_context_data(**kwargs) user = self.request.user today = date.today() context["anchors"] = [ ("#personal-info", _("Persoonlijke gegevens")), - ("#notifications", _("Voorkeuren voor meldingen")), ("#overview", _("Overzicht")), ("#profile-remove", _("Profiel verwijderen")), ] + if config.any_notifications_enabled: + context["anchors"].insert( + 1, ("#notifications", _("Voorkeuren voor meldingen")) + ) # Check if Laposta is configured and user has verified email if LapostaConfig.get_solo().api_root and user.has_verified_email():