mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-14 06:55:08 +02:00
Linting and fix unit test
This commit is contained in:
parent
c949566744
commit
a3f78e2ac7
3 changed files with 11 additions and 16 deletions
|
@ -26,12 +26,8 @@ class DraftDomain(TimeStampedModel, DomainHelper):
|
|||
help_text="The draft number in the event a user doesn't save at this stage",
|
||||
)
|
||||
|
||||
is_incomplete = models.BooleanField(
|
||||
default=False,
|
||||
help_text="Determines if this Draft is complete or not"
|
||||
)
|
||||
is_incomplete = models.BooleanField(default=False, help_text="Determines if this Draft is complete or not")
|
||||
|
||||
def get_default_request_name(self):
|
||||
"""Returns the draft name that would be used for applications if no name exists"""
|
||||
return f"New domain request {self.draft_number}"
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
import logging
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
from django.db.models import Q
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
|
@ -166,9 +164,11 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
|||
|
||||
name_field = "requested_domain__name"
|
||||
|
||||
incomplete_drafts = existing_applications.exclude(requested_domain=None).filter(
|
||||
requested_domain__name__icontains=default_draft_text
|
||||
).order_by(name_field)
|
||||
incomplete_drafts = (
|
||||
existing_applications.exclude(requested_domain=None)
|
||||
.filter(requested_domain__name__icontains=default_draft_text)
|
||||
.order_by(name_field)
|
||||
)
|
||||
|
||||
incomplete_draft_names = incomplete_drafts.values_list(name_field, flat=True)
|
||||
|
||||
|
@ -403,7 +403,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
|||
# Build the submit button that we'll pass to the modal.
|
||||
modal_button = '<button type="submit" ' 'class="usa-button" ' ">Submit request</button>"
|
||||
# Concatenate the modal header that we'll pass to the modal.
|
||||
if self.application.requested_domain:
|
||||
if self.application.requested_domain and not self.application.requested_domain.is_incomplete:
|
||||
modal_heading = "You are about to submit a domain request for " + str(self.application.requested_domain)
|
||||
else:
|
||||
modal_heading = "You are about to submit an incomplete request"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
from registrar.models import DomainApplication, Domain, UserDomainRole
|
||||
from registrar.models.draft_domain import DraftDomain
|
||||
|
||||
|
||||
def index(request):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue