Add successful submission page

This commit is contained in:
Neil Martinsen-Burrell 2022-11-15 14:58:13 -06:00
parent f5c117df9f
commit 8e494e7da1
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
3 changed files with 44 additions and 4 deletions

View file

@ -3,7 +3,7 @@
import logging import logging
from django import forms from django import forms
from django.shortcuts import redirect from django.shortcuts import redirect, render
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
@ -144,5 +144,7 @@ class ApplicationWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
application = self.forms_to_object(form_dict) application = self.forms_to_object(form_dict)
application.submit() # change the status to submitted application.submit() # change the status to submitted
application.save() application.save()
logger.debug("Application object saved:", application.id) logger.debug("Application object saved: %s", application.id)
return redirect("home") return render(
self.request, "application_done.html", {"application_id": application.id}
)

View file

@ -0,0 +1,37 @@
{% extends 'base.html' %}
{% block title %}Thank you for your domain request{% endblock %}
{% block content %}
<h1>Thank you!</h1>
<p>
Thank you for your domain request. We'll email a copy of your request to you,
your authorizing official, and any contacts you added.</p>
<h2>Next steps in this process</h2>
<ul>
<li> We'll review your request. This could take up to two weeks. During
this review we'll verify that you're eligible for a .gov domain, that
your authorizing official approves your request, and that your domain
meets our naming requirements.
</li>
<li> You can <a href="/application/{{ application_id }}">check the
status</a> of your request at any time.
</li>
<li> We'll email you with any questions or when we complete our
review.</li>
</ul>
<h2>Option to enter domain name server information</h2>
<p>Before your domain can be used we'll need information about your
domain name servers. If you have this information you can enter it now.
If you don't have it, that's okay. You can enter it later on the
<a href="/domains">manage your domains page</a>.
</p>
{% endblock %}

View file

@ -113,7 +113,8 @@ class FormTests(TestWithUser, WebTest):
result = page.form.submit() result = page.form.submit()
# final submission results in a redirect # final submission results in a redirect
self.assertEquals(result.status_code, 302) self.assertEquals(result.status_code, 302)
self.assertEquals(result["Location"], "/register/finished/")
page = result.follow() page = result.follow()
self.assertContains(page, "registrar") self.assertContains(page, "Thank you for your domain request")
# TODO: when we have a page that lists applications, visit it and # TODO: when we have a page that lists applications, visit it and
# make sure that the new one exists # make sure that the new one exists