From d93eec9c1b71dd6dadaa6244c9671f05afbb0bed Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 00:46:58 +0000 Subject: [PATCH 1/2] fix(enrollment): show retry button on retry page --- benefits/enrollment/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py index f68a14f6b..40c1e1560 100644 --- a/benefits/enrollment/views.py +++ b/benefits/enrollment/views.py @@ -99,7 +99,10 @@ def retry(request): analytics.returned_retry(request) form = forms.CardTokenizeFailForm(request.POST) if form.is_valid(): - return TemplateResponse(request, TEMPLATE_RETRY) + context = { + "retry_button": True, + } + return TemplateResponse(request, TEMPLATE_RETRY, context) else: analytics.returned_error(request, "Invalid retry submission.") raise Exception("Invalid retry submission.") From 39753d5adcbff6c033a887ca1bb670a76a07bc7b Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 18:36:43 +0000 Subject: [PATCH 2/2] refactor(enrollment): remove retry variable entirely --- benefits/enrollment/templates/enrollment/retry.html | 12 +++++------- benefits/enrollment/views.py | 5 +---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/benefits/enrollment/templates/enrollment/retry.html b/benefits/enrollment/templates/enrollment/retry.html index 7cd0ea9c1..4efb402f8 100644 --- a/benefits/enrollment/templates/enrollment/retry.html +++ b/benefits/enrollment/templates/enrollment/retry.html @@ -26,14 +26,12 @@

{% include "core/includes/agency-links.html" %}
- {% if retry_button %} -
-
- {% translate "Try again" as button_text %} - {% include "core/includes/button--origin.html" with button_text=button_text %} -
+
+
+ {% translate "Try again" as button_text %} + {% include "core/includes/button--origin.html" with button_text=button_text %}
- {% endif %} +
{% endblock main-content %} diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py index 40c1e1560..f68a14f6b 100644 --- a/benefits/enrollment/views.py +++ b/benefits/enrollment/views.py @@ -99,10 +99,7 @@ def retry(request): analytics.returned_retry(request) form = forms.CardTokenizeFailForm(request.POST) if form.is_valid(): - context = { - "retry_button": True, - } - return TemplateResponse(request, TEMPLATE_RETRY, context) + return TemplateResponse(request, TEMPLATE_RETRY) else: analytics.returned_error(request, "Invalid retry submission.") raise Exception("Invalid retry submission.")