remove the dnssec confirmed session

This commit is contained in:
Rachid Mrad 2023-10-23 16:43:45 -04:00
parent ffbae457bf
commit 8bf2432b15
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
2 changed files with 6 additions and 17 deletions

View file

@ -22,7 +22,7 @@
<p>Enter the values given by your DNS provider for DS Data.</p>
{% if not dnssec_ds_confirmed %}
{% comment %} {% if not dnssec_ds_confirmed %}
<p>Required fields are marked with an asterisk (<abbr
title="required"
class="usa-hint usa-hint--required"
@ -35,7 +35,7 @@
</svg><span class="margin-left-05">Add new record</span>
</button>
</form>
{% else %}
{% else %} {% endcomment %}
{% include "includes/required_fields.html" %}
<form class="usa-form usa-form--extra-large" method="post" novalidate id="form-container">
@ -111,7 +111,7 @@
>Cancel
</button>
</form>
{% endif %}
{% comment %} {% endif %} {% endcomment %}
{% if trigger_modal %}
<a

View file

@ -333,9 +333,6 @@ class DomainDsDataView(DomainPermissionView, FormMixin):
# context to back out of a broken form on all fields delete
context["modal_button"] = modal_button
context["dnssec_ds_confirmed"] = self.request.session.get(
"dnssec_ds_confirmed", False
)
return context
@ -345,22 +342,14 @@ class DomainDsDataView(DomainPermissionView, FormMixin):
formset = self.get_form()
override = False
# switch to form in template
if "confirm-ds" in request.POST:
request.session["dnssec_ds_confirmed"] = True
return super().form_valid(formset)
# This is called but the form cancel button, but also by the modal's X and cacel button
# This is called by the form cancel button, and also by the modal's X and cancel buttons
if "btn-cancel-click" in request.POST:
return render(request, 'domain_dsdata.html', {'formset': formset})
return redirect("domain-dns-dnssec-dsdata", {"formset": formset}, RequestContext(request))
if "disable-override-click" in request.POST:
override = True
# we are deleteing all data,
# switch out of form
request.session["dnssec_ds_confirmed"] = False
if len(formset) == 0 and formset.initial != [{}] and override == False:
if len(formset) == 0 and formset.initial == [{}] and override == False:
# trigger the modal
context = self.get_context_data(**kwargs)
context["trigger_modal"] = True