fixed tests and updated code formatting

This commit is contained in:
David Kennedy 2023-10-23 21:16:12 -04:00
parent 6400fa5f4b
commit d354751481
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 6 additions and 7 deletions

View file

@ -1125,7 +1125,7 @@ class TestWithDomainPermissions(TestWithUser):
UserDomainRole.objects.get_or_create( UserDomainRole.objects.get_or_create(
user=self.user, user=self.user,
domain=self.domain_multdsdata, domain=self.domain_multdsdata,
role=UserDomainRole.Roles.ADMIN, role=UserDomainRole.Roles.MANAGER,
) )
UserDomainRole.objects.get_or_create( UserDomainRole.objects.get_or_create(
user=self.user, user=self.user,

View file

@ -12,10 +12,8 @@ from django.contrib.messages.views import SuccessMessageMixin
from django.db import IntegrityError from django.db import IntegrityError
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.shortcuts import redirect from django.shortcuts import redirect
from django.template import RequestContext
from django.urls import reverse from django.urls import reverse
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from django.shortcuts import render
from registrar.models import ( from registrar.models import (
Domain, Domain,
@ -371,18 +369,19 @@ class DomainDsDataView(DomainFormBaseView):
formset = self.get_form() formset = self.get_form()
override = False override = False
# This is called by the form cancel button, and also by the modal's X and cancel buttons # 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: if "btn-cancel-click" in request.POST:
url = self.get_success_url() url = self.get_success_url()
return HttpResponseRedirect(url) return HttpResponseRedirect(url)
# This is called by the Disable DNSSEC modal to override # This is called by the Disable DNSSEC modal to override
if "disable-override-click" in request.POST: if "disable-override-click" in request.POST:
override = True override = True
# This is called when all DNSSEC data has been deleted and the # This is called when all DNSSEC data has been deleted and the
# Save button is pressed # Save button is pressed
if len(formset) == 0 and formset.initial != [{}] and override == False: if len(formset) == 0 and formset.initial != [{}] and override is False:
# trigger the modal # trigger the modal
# get context data from super() rather than self # get context data from super() rather than self
# to preserve the context["form"] # to preserve the context["form"]