Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2338] Add newsletters to sidebar navigation #1195

Merged
merged 2 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/open_inwoner/accounts/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)
from open_inwoner.haalcentraal.utils import fetch_brp
from open_inwoner.laposta.forms import NewsletterSubscriptionForm
from open_inwoner.laposta.models import LapostaConfig
from open_inwoner.openklant.clients import build_client
from open_inwoner.openklant.wrap import get_fetch_parameters
from open_inwoner.plans.models import Plan
Expand Down Expand Up @@ -107,6 +108,11 @@ def get_context_data(self, **kwargs):
("#profile-remove", _("Profiel verwijderen")),
]

# Check if Laposta is configured and user has verified email
if LapostaConfig.get_solo().api_root and user.has_verified_email():
# Insert #newsletters anchor
context["anchors"].insert(2, ("#newsletters", _("Nieuwsbrieven")))

user_files = user.get_all_files()

# Mentor contacts + names for display
Expand Down
Loading