mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-09 14:04:44 +02:00
Merge branch 'main' into ky/required-optional-form-fields
This commit is contained in:
commit
3cc6befeb7
16 changed files with 166 additions and 28 deletions
|
@ -8,6 +8,7 @@ from django.test import RequestFactory
|
||||||
from ..views import available, check_domain_available
|
from ..views import available, check_domain_available
|
||||||
from .common import less_console_noise
|
from .common import less_console_noise
|
||||||
from registrar.tests.common import MockEppLib
|
from registrar.tests.common import MockEppLib
|
||||||
|
from registrar.utility.errors import GenericError, GenericErrorCodes
|
||||||
from unittest.mock import call
|
from unittest.mock import call
|
||||||
|
|
||||||
from epplibwrapper import (
|
from epplibwrapper import (
|
||||||
|
@ -100,16 +101,25 @@ class AvailableViewTest(MockEppLib):
|
||||||
response = available(request, domain="igorville")
|
response = available(request, domain="igorville")
|
||||||
self.assertTrue(json.loads(response.content)["available"])
|
self.assertTrue(json.loads(response.content)["available"])
|
||||||
|
|
||||||
def test_error_handling(self):
|
def test_bad_string_handling(self):
|
||||||
"""Calling with bad strings raises an error."""
|
"""Calling with bad strings returns unavailable."""
|
||||||
bad_string = "blah!;"
|
bad_string = "blah!;"
|
||||||
request = self.factory.get(API_BASE_PATH + bad_string)
|
request = self.factory.get(API_BASE_PATH + bad_string)
|
||||||
request.user = self.user
|
request.user = self.user
|
||||||
response = available(request, domain=bad_string)
|
response = available(request, domain=bad_string)
|
||||||
self.assertFalse(json.loads(response.content)["available"])
|
self.assertFalse(json.loads(response.content)["available"])
|
||||||
# domain set to raise error returns false for availability
|
|
||||||
error_domain_available = available(request, "errordomain.gov")
|
def test_error_handling(self):
|
||||||
self.assertFalse(json.loads(error_domain_available.content)["available"])
|
"""Error thrown while calling availabilityAPI returns error."""
|
||||||
|
request = self.factory.get(API_BASE_PATH + "errordomain.gov")
|
||||||
|
request.user = self.user
|
||||||
|
# domain set to raise error returns false for availability and error message
|
||||||
|
error_domain_response = available(request, domain="errordomain.gov")
|
||||||
|
self.assertFalse(json.loads(error_domain_response.content)["available"])
|
||||||
|
self.assertEqual(
|
||||||
|
GenericError.get_error_message(GenericErrorCodes.CANNOT_CONTACT_REGISTRY),
|
||||||
|
json.loads(error_domain_response.content)["message"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AvailableAPITest(MockEppLib):
|
class AvailableAPITest(MockEppLib):
|
||||||
|
|
|
@ -5,6 +5,7 @@ from django.http import JsonResponse
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
from registrar.templatetags.url_helpers import public_site_url
|
from registrar.templatetags.url_helpers import public_site_url
|
||||||
|
from registrar.utility.errors import GenericError, GenericErrorCodes
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ DOMAIN_API_MESSAGES = {
|
||||||
),
|
),
|
||||||
"invalid": "Enter a domain using only letters, numbers, or hyphens (though we don't recommend using hyphens).",
|
"invalid": "Enter a domain using only letters, numbers, or hyphens (though we don't recommend using hyphens).",
|
||||||
"success": "That domain is available!",
|
"success": "That domain is available!",
|
||||||
"error": "Error finding domain availability.",
|
"error": GenericError.get_error_message(GenericErrorCodes.CANNOT_CONTACT_REGISTRY),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,17 +64,14 @@ def check_domain_available(domain):
|
||||||
|
|
||||||
The given domain is lowercased to match against the domains list. If the
|
The given domain is lowercased to match against the domains list. If the
|
||||||
given domain doesn't end with .gov, ".gov" is added when looking for
|
given domain doesn't end with .gov, ".gov" is added when looking for
|
||||||
a match.
|
a match. If check fails, throws a RegistryError.
|
||||||
"""
|
"""
|
||||||
Domain = apps.get_model("registrar.Domain")
|
Domain = apps.get_model("registrar.Domain")
|
||||||
try:
|
if domain.endswith(".gov"):
|
||||||
if domain.endswith(".gov"):
|
return Domain.available(domain)
|
||||||
return Domain.available(domain)
|
else:
|
||||||
else:
|
# domain search string doesn't end with .gov, add it on here
|
||||||
# domain search string doesn't end with .gov, add it on here
|
return Domain.available(domain + ".gov")
|
||||||
return Domain.available(domain + ".gov")
|
|
||||||
except Exception:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
|
|
|
@ -399,6 +399,8 @@ class AlternativeDomainForm(RegistrarForm):
|
||||||
raise forms.ValidationError(DOMAIN_API_MESSAGES["extra_dots"], code="extra_dots")
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["extra_dots"], code="extra_dots")
|
||||||
except errors.DomainUnavailableError:
|
except errors.DomainUnavailableError:
|
||||||
raise forms.ValidationError(DOMAIN_API_MESSAGES["unavailable"], code="unavailable")
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["unavailable"], code="unavailable")
|
||||||
|
except errors.RegistrySystemError:
|
||||||
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["error"], code="error")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise forms.ValidationError(DOMAIN_API_MESSAGES["invalid"], code="invalid")
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["invalid"], code="invalid")
|
||||||
return validated
|
return validated
|
||||||
|
@ -484,6 +486,8 @@ class DotGovDomainForm(RegistrarForm):
|
||||||
raise forms.ValidationError(DOMAIN_API_MESSAGES["extra_dots"], code="extra_dots")
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["extra_dots"], code="extra_dots")
|
||||||
except errors.DomainUnavailableError:
|
except errors.DomainUnavailableError:
|
||||||
raise forms.ValidationError(DOMAIN_API_MESSAGES["unavailable"], code="unavailable")
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["unavailable"], code="unavailable")
|
||||||
|
except errors.RegistrySystemError:
|
||||||
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["error"], code="error")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise forms.ValidationError(DOMAIN_API_MESSAGES["invalid"], code="invalid")
|
raise forms.ValidationError(DOMAIN_API_MESSAGES["invalid"], code="invalid")
|
||||||
return validated
|
return validated
|
||||||
|
|
|
@ -176,6 +176,7 @@ class Command(BaseCommand):
|
||||||
"clienthold": TransitionDomain.StatusChoices.ON_HOLD,
|
"clienthold": TransitionDomain.StatusChoices.ON_HOLD,
|
||||||
"created": TransitionDomain.StatusChoices.READY,
|
"created": TransitionDomain.StatusChoices.READY,
|
||||||
"ok": TransitionDomain.StatusChoices.READY,
|
"ok": TransitionDomain.StatusChoices.READY,
|
||||||
|
"unknown": TransitionDomain.StatusChoices.UNKNOWN,
|
||||||
}
|
}
|
||||||
mapped_status = status_maps.get(status_to_map)
|
mapped_status = status_maps.get(status_to_map)
|
||||||
return mapped_status
|
return mapped_status
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 4.2.7 on 2023-12-01 17:45
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("registrar", "0047_transitiondomain_address_line_transitiondomain_city_and_more"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="transitiondomain",
|
||||||
|
name="status",
|
||||||
|
field=models.CharField(
|
||||||
|
blank=True,
|
||||||
|
choices=[("ready", "Ready"), ("on hold", "On Hold"), ("unknown", "Unknown")],
|
||||||
|
default="ready",
|
||||||
|
help_text="domain status during the transfer",
|
||||||
|
max_length=255,
|
||||||
|
verbose_name="Status",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -5,6 +5,7 @@ from .utility.time_stamped_model import TimeStampedModel
|
||||||
class StatusChoices(models.TextChoices):
|
class StatusChoices(models.TextChoices):
|
||||||
READY = "ready", "Ready"
|
READY = "ready", "Ready"
|
||||||
ON_HOLD = "on hold", "On Hold"
|
ON_HOLD = "on hold", "On Hold"
|
||||||
|
UNKNOWN = "unknown", "Unknown"
|
||||||
|
|
||||||
|
|
||||||
class TransitionDomain(TimeStampedModel):
|
class TransitionDomain(TimeStampedModel):
|
||||||
|
|
|
@ -2,6 +2,7 @@ import re
|
||||||
|
|
||||||
from api.views import check_domain_available
|
from api.views import check_domain_available
|
||||||
from registrar.utility import errors
|
from registrar.utility import errors
|
||||||
|
from epplibwrapper.errors import RegistryError
|
||||||
|
|
||||||
|
|
||||||
class DomainHelper:
|
class DomainHelper:
|
||||||
|
@ -29,19 +30,19 @@ class DomainHelper:
|
||||||
if not isinstance(domain, str):
|
if not isinstance(domain, str):
|
||||||
raise ValueError("Domain name must be a string")
|
raise ValueError("Domain name must be a string")
|
||||||
domain = domain.lower().strip()
|
domain = domain.lower().strip()
|
||||||
if domain == "":
|
if domain == "" and not blank_ok:
|
||||||
if blank_ok:
|
raise errors.BlankValueError()
|
||||||
return domain
|
|
||||||
else:
|
|
||||||
raise errors.BlankValueError()
|
|
||||||
if domain.endswith(".gov"):
|
if domain.endswith(".gov"):
|
||||||
domain = domain[:-4]
|
domain = domain[:-4]
|
||||||
if "." in domain:
|
if "." in domain:
|
||||||
raise errors.ExtraDotsError()
|
raise errors.ExtraDotsError()
|
||||||
if not DomainHelper.string_could_be_domain(domain + ".gov"):
|
if not DomainHelper.string_could_be_domain(domain + ".gov"):
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
if not check_domain_available(domain):
|
try:
|
||||||
raise errors.DomainUnavailableError()
|
if not check_domain_available(domain):
|
||||||
|
raise errors.DomainUnavailableError()
|
||||||
|
except RegistryError as err:
|
||||||
|
raise errors.RegistrySystemError() from err
|
||||||
return domain
|
return domain
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -22,6 +22,14 @@
|
||||||
{% include "includes/form_messages.html" %}
|
{% include "includes/form_messages.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% if pending_requests_message %}
|
||||||
|
<div class="usa-alert usa-alert--info margin-bottom-3">
|
||||||
|
<div class="usa-alert__body">
|
||||||
|
{{ pending_requests_message }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block form_errors %}
|
{% block form_errors %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
to make sense of this loop, consider that
|
to make sense of this loop, consider that
|
||||||
|
@ -69,6 +77,13 @@
|
||||||
value="next"
|
value="next"
|
||||||
class="usa-button"
|
class="usa-button"
|
||||||
>Save and continue</button>
|
>Save and continue</button>
|
||||||
|
{% elif pending_requests_exist %}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
name="submit_button"
|
||||||
|
value="save_and_return"
|
||||||
|
class="usa-button usa-button--outline"
|
||||||
|
>Save and return to manage your domains</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
@ -40,9 +40,9 @@
|
||||||
>
|
>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div id="enable-dnssec">
|
<div id="enable-dnssec">
|
||||||
<div class="usa-alert usa-alert--info usa-alert--slim">
|
<div class="usa-alert usa-alert--info">
|
||||||
<div class="usa-alert__body">
|
<div class="usa-alert__body">
|
||||||
It is strongly recommended that you only enable DNSSEC if you know how to set it up properly at your hosting service. If you make a mistake, it could cause your domain name to stop working.
|
<p class="margin-y-0">It is strongly recommended that you only enable DNSSEC if you know how to set it up properly at your hosting service. If you make a mistake, it could cause your domain name to stop working.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="{% url 'domain-dns-dnssec-dsdata' pk=domain.id %}" class="usa-button">Enable DNSSEC</a>
|
<a href="{% url 'domain-dns-dnssec-dsdata' pk=domain.id %}" class="usa-button">Enable DNSSEC</a>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<p>Add a name server record by entering the address (e.g., ns1.nameserver.com) in the name server fields below. You must add at least two name servers (13 max).</p>
|
<p>Add a name server record by entering the address (e.g., ns1.nameserver.com) in the name server fields below. You must add at least two name servers (13 max).</p>
|
||||||
|
|
||||||
<div class="usa-alert usa-alert--slim usa-alert--info">
|
<div class="usa-alert usa-alert--info">
|
||||||
<div class="usa-alert__body">
|
<div class="usa-alert__body">
|
||||||
<p class="margin-top-0">Add an IP address only when your name server's address includes your domain name (e.g., if your domain name is “example.gov” and your name server is “ns1.example.gov,” then an IP address is required). Multiple IP addresses must be separated with commas.</p>
|
<p class="margin-top-0">Add an IP address only when your name server's address includes your domain name (e.g., if your domain name is “example.gov” and your name server is “ns1.example.gov,” then an IP address is required). Multiple IP addresses must be separated with commas.</p>
|
||||||
<p class="margin-bottom-0">This step is uncommon unless you self-host your DNS or use custom addresses for your nameserver.</p>
|
<p class="margin-bottom-0">This step is uncommon unless you self-host your DNS or use custom addresses for your nameserver.</p>
|
||||||
|
|
|
@ -2,4 +2,4 @@ Anomaly.gov|muahaha|
|
||||||
TestDomain.gov|ok|
|
TestDomain.gov|ok|
|
||||||
FakeWebsite1.gov|serverHold|
|
FakeWebsite1.gov|serverHold|
|
||||||
FakeWebsite2.gov|Hold|
|
FakeWebsite2.gov|Hold|
|
||||||
FakeWebsite3.gov|ok|
|
FakeWebsite3.gov|unknown|
|
||||||
|
|
|
@ -193,6 +193,17 @@ class TestOrganizationMigration(TestCase):
|
||||||
|
|
||||||
self.assertEqual(transition, expected_transition_domain)
|
self.assertEqual(transition, expected_transition_domain)
|
||||||
|
|
||||||
|
def test_transition_domain_status_unknown(self):
|
||||||
|
"""
|
||||||
|
Test that a domain in unknown status can be loaded
|
||||||
|
""" # noqa - E501 (harder to read)
|
||||||
|
# == First, parse all existing data == #
|
||||||
|
self.run_load_domains()
|
||||||
|
self.run_transfer_domains()
|
||||||
|
|
||||||
|
domain_object = Domain.objects.get(name="fakewebsite3.gov")
|
||||||
|
self.assertEqual(domain_object.state, Domain.State.UNKNOWN)
|
||||||
|
|
||||||
def test_load_organization_data_domain_information(self):
|
def test_load_organization_data_domain_information(self):
|
||||||
"""
|
"""
|
||||||
This test verifies the functionality of the load_organization_data method.
|
This test verifies the functionality of the load_organization_data method.
|
||||||
|
|
|
@ -144,6 +144,18 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
result = page.form.submit()
|
result = page.form.submit()
|
||||||
self.assertIn("What kind of U.S.-based government organization do you represent?", result)
|
self.assertIn("What kind of U.S.-based government organization do you represent?", result)
|
||||||
|
|
||||||
|
def test_application_multiple_applications_exist(self):
|
||||||
|
"""Test that an info message appears when user has multiple applications already"""
|
||||||
|
# create and submit an application
|
||||||
|
application = completed_application(user=self.user)
|
||||||
|
application.submit()
|
||||||
|
application.save()
|
||||||
|
|
||||||
|
# now, attempt to create another one
|
||||||
|
with less_console_noise():
|
||||||
|
page = self.app.get("/register/").follow()
|
||||||
|
self.assertContains(page, "You cannot submit this request yet")
|
||||||
|
|
||||||
@boto3_mocking.patching
|
@boto3_mocking.patching
|
||||||
def test_application_form_submission(self):
|
def test_application_form_submission(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -13,6 +13,10 @@ class DomainUnavailableError(ValueError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class RegistrySystemError(ValueError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ActionNotAllowed(Exception):
|
class ActionNotAllowed(Exception):
|
||||||
"""User accessed an action that is not
|
"""User accessed an action that is not
|
||||||
allowed by the current state"""
|
allowed by the current state"""
|
||||||
|
@ -42,7 +46,7 @@ class GenericError(Exception):
|
||||||
GenericErrorCodes.CANNOT_CONTACT_REGISTRY: """
|
GenericErrorCodes.CANNOT_CONTACT_REGISTRY: """
|
||||||
We’re experiencing a system connection error. Please wait a few minutes
|
We’re experiencing a system connection error. Please wait a few minutes
|
||||||
and try again. If you continue to receive this error after a few tries,
|
and try again. If you continue to receive this error after a few tries,
|
||||||
contact help@get.gov
|
contact help@get.gov.
|
||||||
""",
|
""",
|
||||||
GenericErrorCodes.GENERIC_ERROR: ("Value entered was wrong."),
|
GenericErrorCodes.GENERIC_ERROR: ("Value entered was wrong."),
|
||||||
}
|
}
|
||||||
|
@ -56,6 +60,10 @@ contact help@get.gov
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.message}"
|
return f"{self.message}"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_error_message(self, code=None):
|
||||||
|
return self._error_mapping.get(code)
|
||||||
|
|
||||||
|
|
||||||
class NameserverErrorCodes(IntEnum):
|
class NameserverErrorCodes(IntEnum):
|
||||||
"""Used in the NameserverError class for
|
"""Used in the NameserverError class for
|
||||||
|
|
|
@ -3,6 +3,7 @@ import logging
|
||||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||||
from django.shortcuts import redirect, render
|
from django.shortcuts import redirect, render
|
||||||
from django.urls import resolve, reverse
|
from django.urls import resolve, reverse
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
@ -218,6 +219,23 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
||||||
self.steps.current = current_url
|
self.steps.current = current_url
|
||||||
context = self.get_context_data()
|
context = self.get_context_data()
|
||||||
context["forms"] = self.get_forms()
|
context["forms"] = self.get_forms()
|
||||||
|
|
||||||
|
# if pending requests exist and user does not have approved domains,
|
||||||
|
# present message that domain application cannot be submitted
|
||||||
|
pending_requests = self.pending_requests()
|
||||||
|
if len(pending_requests) > 0:
|
||||||
|
message_header = "You cannot submit this request yet"
|
||||||
|
message_content = (
|
||||||
|
f"<h4 class='usa-alert__heading'>{message_header}</h4> "
|
||||||
|
"<p class='margin-bottom-0'>New domain requests cannot be submitted until we have finished "
|
||||||
|
f"reviewing your pending request: <strong>{pending_requests[0].requested_domain}</strong>. "
|
||||||
|
"You can continue to fill out this request and save it as a draft to be submitted later. "
|
||||||
|
f"<a class='usa-link' href='{reverse('home')}'>View your pending requests.</a></p>"
|
||||||
|
)
|
||||||
|
context["pending_requests_message"] = mark_safe(message_content) # nosec
|
||||||
|
|
||||||
|
context["pending_requests_exist"] = len(pending_requests) > 0
|
||||||
|
|
||||||
return render(request, self.template_name, context)
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
def get_all_forms(self, **kwargs) -> list:
|
def get_all_forms(self, **kwargs) -> list:
|
||||||
|
@ -266,6 +284,37 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
||||||
|
|
||||||
return instantiated
|
return instantiated
|
||||||
|
|
||||||
|
def pending_requests(self):
|
||||||
|
"""return an array of pending requests if user has pending requests
|
||||||
|
and no approved requests"""
|
||||||
|
if self.approved_applications_exist() or self.approved_domains_exist():
|
||||||
|
return []
|
||||||
|
else:
|
||||||
|
return self.pending_applications()
|
||||||
|
|
||||||
|
def approved_applications_exist(self):
|
||||||
|
"""Checks if user is creator of applications with APPROVED status"""
|
||||||
|
approved_application_count = DomainApplication.objects.filter(
|
||||||
|
creator=self.request.user, status=DomainApplication.APPROVED
|
||||||
|
).count()
|
||||||
|
return approved_application_count > 0
|
||||||
|
|
||||||
|
def approved_domains_exist(self):
|
||||||
|
"""Checks if user has permissions on approved domains
|
||||||
|
|
||||||
|
This additional check is necessary to account for domains which were migrated
|
||||||
|
and do not have an application"""
|
||||||
|
return self.request.user.permissions.count() > 0
|
||||||
|
|
||||||
|
def pending_applications(self):
|
||||||
|
"""Returns a List of user's applications with one of the following states:
|
||||||
|
SUBMITTED, IN_REVIEW, ACTION_NEEDED"""
|
||||||
|
# if the current application has ACTION_NEEDED status, this check should not be performed
|
||||||
|
if self.application.status == DomainApplication.ACTION_NEEDED:
|
||||||
|
return []
|
||||||
|
check_statuses = [DomainApplication.SUBMITTED, DomainApplication.IN_REVIEW, DomainApplication.ACTION_NEEDED]
|
||||||
|
return DomainApplication.objects.filter(creator=self.request.user, status__in=check_statuses)
|
||||||
|
|
||||||
def get_context_data(self):
|
def get_context_data(self):
|
||||||
"""Define context for access on all wizard pages."""
|
"""Define context for access on all wizard pages."""
|
||||||
return {
|
return {
|
||||||
|
@ -328,6 +377,10 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
||||||
if button == "save":
|
if button == "save":
|
||||||
messages.success(request, "Your progress has been saved!")
|
messages.success(request, "Your progress has been saved!")
|
||||||
return self.goto(self.steps.current)
|
return self.goto(self.steps.current)
|
||||||
|
# if user opted to save progress and return,
|
||||||
|
# return them to the home page
|
||||||
|
if button == "save_and_return":
|
||||||
|
return HttpResponseRedirect(reverse("home"))
|
||||||
# otherwise, proceed as normal
|
# otherwise, proceed as normal
|
||||||
return self.goto_next_step()
|
return self.goto_next_step()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ certifi==2023.7.22; python_version >= '3.6'
|
||||||
cfenv==0.5.3
|
cfenv==0.5.3
|
||||||
cffi==1.16.0; python_version >= '3.8'
|
cffi==1.16.0; python_version >= '3.8'
|
||||||
charset-normalizer==3.3.2; python_full_version >= '3.7.0'
|
charset-normalizer==3.3.2; python_full_version >= '3.7.0'
|
||||||
cryptography==41.0.5; python_version >= '3.7'
|
cryptography==41.0.6; python_version >= '3.7'
|
||||||
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
||||||
dj-database-url==2.1.0
|
dj-database-url==2.1.0
|
||||||
dj-email-url==1.0.6
|
dj-email-url==1.0.6
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue