mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
fixed cancel button on nameservers
This commit is contained in:
parent
1297f15341
commit
0dbcb749a6
2 changed files with 11 additions and 11 deletions
|
@ -76,16 +76,14 @@
|
|||
class="usa-button"
|
||||
>Save
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="usa-button usa-button--outline"
|
||||
name="btn-cancel-click"
|
||||
aria-label="Reset the data in the Name Server form to the registry state (undo changes)"
|
||||
>Cancel
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form aria-label="form to undo changes to the Name Servers">
|
||||
<button
|
||||
type="submit"
|
||||
class="usa-button usa-button--outline btn-cancel"
|
||||
name="btn-cancel-click"
|
||||
aria-label="Reset the data in the Name Server form to the registry state (undo changes)"
|
||||
>Cancel
|
||||
</button>
|
||||
</form>
|
||||
{% endblock %} {# domain_content #}
|
||||
|
|
|
@ -10,6 +10,7 @@ import logging
|
|||
from django.contrib import messages
|
||||
from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.db import IntegrityError
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import redirect
|
||||
from django.template import RequestContext
|
||||
from django.urls import reverse
|
||||
|
@ -272,7 +273,8 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet):
|
|||
formset = self.get_form()
|
||||
|
||||
if "btn-cancel-click" in request.POST:
|
||||
return redirect("/", {"formset": formset}, RequestContext(request))
|
||||
url = self.get_success_url()
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
if formset.is_valid():
|
||||
return self.form_valid(formset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue