From 73366ac86ce1c930cf708ff19bde3d1fd30ace6c Mon Sep 17 00:00:00 2001 From: jenriordan Date: Mon, 19 Feb 2024 16:21:34 +0000 Subject: [PATCH] initial commit --- Pipfile | 2 -- report_a_breach/base_classes/views.py | 17 +++++++++++++++++ report_a_breach/templates/summary.html | 6 +++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 72e34a91..a6b767f8 100644 --- a/Pipfile +++ b/Pipfile @@ -34,7 +34,5 @@ djhtml = "*" pyproject-flake8 = "*" boto3 = "*" -[dev-packages] - [requires] python_version = "3.11" diff --git a/report_a_breach/base_classes/views.py b/report_a_breach/base_classes/views.py index e44b829b..74f824c8 100644 --- a/report_a_breach/base_classes/views.py +++ b/report_a_breach/base_classes/views.py @@ -43,3 +43,20 @@ def process_step(self, form): if custom_getter := getattr(self, f"process_{self.steps.current}_step", None): return custom_getter(form) return super().process_step(form) + + def post(self, request, **kwargs): + # TODO: this code isn't reachable if the user selects change on the summary page. + # TODO: need further debug - possible to add to a process step + # TODO: investigate wizard forms redirect methods? + for key, value in request.POST.items(): + print(key, value) + if value == "summary": + kwargs["redirect_to"] = "summary" + print(kwargs) + return super().post(request, **kwargs) + for key, value in kwargs.items(): + print(f"kwargs {key, value}") + if key == "redirect_to": + print("attempting redirect to summary page") + return reverse("summary") + return super().post(request, **kwargs) diff --git a/report_a_breach/templates/summary.html b/report_a_breach/templates/summary.html index 34b865a2..5389ab38 100644 --- a/report_a_breach/templates/summary.html +++ b/report_a_breach/templates/summary.html @@ -22,7 +22,7 @@

Your details

{{ reporter_email_address }}
- Change email (Your details) + Change email (Your details)
@@ -33,7 +33,7 @@

Your details

{{ reporter_full_name }}
- Change full name (Your details) + Change full name (Your details)
@@ -45,7 +45,7 @@

Your details

{{ company_relationship }}
- Change professional relationship with the organisation (Your details) + Change professional relationship with the organisation (Your details)