diff --git a/src/open_inwoner/accounts/tests/test_password_reset_view.py b/src/open_inwoner/accounts/tests/test_password_reset_view.py index 88fc5fcabe..d2e91bd5dc 100644 --- a/src/open_inwoner/accounts/tests/test_password_reset_view.py +++ b/src/open_inwoner/accounts/tests/test_password_reset_view.py @@ -1,3 +1,4 @@ +from django.core.cache import cache from django.test import TestCase from django.urls import reverse @@ -5,6 +6,7 @@ class PasswordResetViewTests(TestCase): def test_user_cant_access_the_password_reset_view_more_than_5_times(self): url = reverse("admin_password_reset") + cache.clear() for i in range(5): response = self.client.get(url) diff --git a/src/open_inwoner/accounts/views/cases.py b/src/open_inwoner/accounts/views/cases.py index d5d5294e4a..243c3b5913 100644 --- a/src/open_inwoner/accounts/views/cases.py +++ b/src/open_inwoner/accounts/views/cases.py @@ -1,4 +1,5 @@ from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin +from django.core.cache import cache from django.shortcuts import redirect from django.urls import reverse from django.utils.functional import cached_property @@ -44,7 +45,10 @@ def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) cases = fetch_cases(self.request.user.bsn) - case_types = {case_type.url: case_type for case_type in fetch_case_types()} + case_types = cache.get("case_types") + if not case_types: + case_types = {case_type.url: case_type for case_type in fetch_case_types()} + cache.set("case_types", case_types, 60 * 60) status_types = { status_type.url: status_type for status_type in fetch_status_types() } @@ -65,8 +69,9 @@ def get_context_data(self, **kwargs): { "uuid": str(case.uuid), "start_date": case.startdatum, - "end_date": case.einddatum, - "description": case_types[case.zaaktype].omschrijving + "end_date": case.einddatum if hasattr(case, "einddatum") else None, + "description": case.omschrijving, + "zaaktype_description": case_types[case.zaaktype].omschrijving if case_types else _("No data available"), "current_status": status_types[ @@ -82,9 +87,17 @@ def get_context_data(self, **kwargs): ("#completed_apps", _("Afgeronde aanvragen")), ] - context["open_cases"] = [case for case in updated_cases if not case["end_date"]] + context["open_cases"] = [ + case + for case in updated_cases + if not case["end_date"] and not case["current_status"] == "Afgerond" + ] context["open_cases"].sort(key=lambda case: case["start_date"]) - context["closed_cases"] = [case for case in updated_cases if case["end_date"]] + context["closed_cases"] = [ + case + for case in updated_cases + if case["end_date"] or case["current_status"] == "Afgerond" + ] context["closed_cases"].sort(key=lambda case: case["end_date"]) return context @@ -134,9 +147,11 @@ def get_context_data(self, **kwargs): status.statustype = status_type context["case"] = { + "identification": case.identificatie, "start_date": case.startdatum, - "end_date": case.einddatum, - "description": case_type.omschrijving + "end_date": case.einddatum if hasattr(case, "einddatum") else None, + "description": case.omschrijving, + "type_description": case_type.omschrijving if case_type else _("No data available"), "current_status": statuses[-1].statustype.omschrijving diff --git a/src/open_inwoner/components/templates/components/Footer/Footer.html b/src/open_inwoner/components/templates/components/Footer/Footer.html index a6e5b1a76d..8cf9d4cb74 100644 --- a/src/open_inwoner/components/templates/components/Footer/Footer.html +++ b/src/open_inwoner/components/templates/components/Footer/Footer.html @@ -10,7 +10,9 @@
{{footer_texts.footer_visiting_intro|linebreaksbr}}
+ {% if footer_texts.footer_visiting_map %} {% button icon="arrow_forward" icon_position='before' transparent=True text=_("Bekijk op Google Maps") href=footer_texts.footer_visiting_map %} + {% endif %} diff --git a/src/open_inwoner/components/templates/components/Header/AccessibilityHeader.html b/src/open_inwoner/components/templates/components/Header/AccessibilityHeader.html index fef8032084..f4ab5812a5 100644 --- a/src/open_inwoner/components/templates/components/Header/AccessibilityHeader.html +++ b/src/open_inwoner/components/templates/components/Header/AccessibilityHeader.html @@ -4,7 +4,7 @@{{ case.type_description }}
{% endrender_column %} {% endrender_grid %} {% else %} diff --git a/src/open_inwoner/templates/pages/product/detail.html b/src/open_inwoner/templates/pages/product/detail.html index a31b7d8594..232b95d87b 100644 --- a/src/open_inwoner/templates/pages/product/detail.html +++ b/src/open_inwoner/templates/pages/product/detail.html @@ -123,6 +123,7 @@{{ contact.organization|default:_('E-mail')}}
{% endrender_column %} {% render_column start=7 span=6 %} {% link href='mailto:'|add:contact.email text=contact.email primary=True %} - {% endrender_column %} + {% endrender_column %} + {% endif %} {% endrender_grid %} {% endfor %} {% endrender_notification %}