Skip to content

Commit

Permalink
Merge pull request #1400 from maykinmedia/fix/2759-anchor-conditional…
Browse files Browse the repository at this point in the history
…-voorkeuren

[#2760] Correct sidebar for when notifications are off
  • Loading branch information
alextreme authored Sep 18, 2024
2 parents 1d85c41 + afb6040 commit 70a77e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/open_inwoner/accounts/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 70a77e2

Please sign in to comment.