Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jenriordan committed Feb 19, 2024
1 parent 90787c0 commit 73366ac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ djhtml = "*"
pyproject-flake8 = "*"
boto3 = "*"

[dev-packages]

[requires]
python_version = "3.11"
17 changes: 17 additions & 0 deletions report_a_breach/base_classes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions report_a_breach/templates/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2 class="govuk-summary-card__title">Your details</h2>
{{ reporter_email_address }}
</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="">Change<span class="govuk-visually-hidden"> email (Your details)</span></a>
<a class="govuk-link" href="/report_a_breach/email">Change<span class="govuk-visually-hidden"> email (Your details)</span></a>
</dd>
</div>
<div class="govuk-summary-list__row">
Expand All @@ -33,7 +33,7 @@ <h2 class="govuk-summary-card__title">Your details</h2>
{{ reporter_full_name }}
</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="/name/{{ pk }}">Change<span class="govuk-visually-hidden"> full name (Your details)</span></a>
<a class="govuk-link" href="/report_a_breach/name">Change<span class="govuk-visually-hidden"> full name (Your details)</span></a>
</dd>
</div>
<div class="govuk-summary-list__row">
Expand All @@ -45,7 +45,7 @@ <h2 class="govuk-summary-card__title">Your details</h2>
{{ company_relationship }}
</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="/start">Change<span class="govuk-visually-hidden"> professional relationship with the organisation (Your details)</span></a>
<a class="govuk-link" href="/report_a_breach/start">Change<span class="govuk-visually-hidden"> professional relationship with the organisation (Your details)</span></a>
</dd>
</div>
</dl>
Expand Down

0 comments on commit 73366ac

Please sign in to comment.