mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 12:39:43 +02:00
Merge branch 'main' into nmb/organization-type
This commit is contained in:
commit
fd687b8e3b
5 changed files with 73 additions and 11 deletions
|
@ -123,3 +123,17 @@ In an effort to keep our domain logic centralized, we are representing the state
|
||||||
objects in the application using the [django-fsm](https://github.com/viewflow/django-fsm)
|
objects in the application using the [django-fsm](https://github.com/viewflow/django-fsm)
|
||||||
library. See the [ADR number 15](../architecture/decisions/0015-use-django-fs.md) for
|
library. See the [ADR number 15](../architecture/decisions/0015-use-django-fs.md) for
|
||||||
more information on the topic.
|
more information on the topic.
|
||||||
|
|
||||||
|
## Login Time Bug
|
||||||
|
|
||||||
|
If you are seeing errors related to openid complaining about issuing a token from the future like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
ERROR [djangooidc.oidc:243] Issued in the future
|
||||||
|
```
|
||||||
|
|
||||||
|
it may help to resync your laptop with time.nist.gov:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo sntp -sS time.nist.gov
|
||||||
|
```
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main-content" class="grid-container">
|
<main id="main-content" class="grid-container">
|
||||||
|
|
||||||
<h2>{% translate "Page not found" %}</h2>
|
<h1>{% translate "Page not found" %}</h1>
|
||||||
|
|
||||||
<p>{% translate "The requested page could not be found." %}</p>
|
<p>{% translate "The requested page could not be found." %}</p>
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,51 @@
|
||||||
<section class="usa-hero">
|
<section class="usa-hero">
|
||||||
<div class="usa-grid">
|
<div class="usa-grid">
|
||||||
<div class="usa-hero-callout usa-section-dark">
|
<div class="usa-hero-callout usa-section-dark">
|
||||||
<h2>
|
<h1>
|
||||||
<span class="usa-hero-callout-alt">Welcome to the .gov registrar</span>
|
<span class="usa-hero-callout-alt">Welcome to the .gov registrar</span>
|
||||||
</h2>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main-content" class="grid-container">
|
<main id="main-content" class="grid-container">
|
||||||
<p>This is the .gov registrar.</p>
|
<p>This is the .gov registrar.</p>
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<p><a href="/openid/logout/">Click here to log out.</a></p>
|
|
||||||
{% else %}
|
{% if domain_applications %}
|
||||||
<p><a href="/openid/login/">Click here to log in.</a></p>
|
<h2>Your domain applications</h2>
|
||||||
{% endif %}
|
<table class="usa-table usa-table--borderless">
|
||||||
|
<caption class="sr-only">Your domain applications</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for application in domain_applications %}
|
||||||
|
<tr>
|
||||||
|
<th>{{ application.requested_domain.website }}</th>
|
||||||
|
<td>{{ application.status }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p><a href="{% url 'application' %}" class="usa-button">Apply</a></p>
|
||||||
|
|
||||||
|
<p><a href="{% url 'edit-profile' %}">Edit profile</a></p>
|
||||||
|
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<p><a href="{% url 'admin:index' %}">CISA admin panel</a></p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p><a href="{% url 'logout' %}">Click here to log out.</a></p>
|
||||||
|
{% else %}
|
||||||
|
<p><a href="{% url 'login' %}">Click here to log in.</a></p>
|
||||||
|
{% endif %}
|
||||||
</main>
|
</main>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.contrib.auth import get_user_model
|
||||||
|
|
||||||
from django_webtest import WebTest # type: ignore
|
from django_webtest import WebTest # type: ignore
|
||||||
|
|
||||||
from registrar.models import DomainApplication
|
from registrar.models import DomainApplication, Website
|
||||||
from registrar.forms.application_wizard import TITLES
|
from registrar.forms.application_wizard import TITLES
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,6 +55,18 @@ class LoggedInTests(TestWithUser):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.client.force_login(self.user)
|
self.client.force_login(self.user)
|
||||||
|
|
||||||
|
def test_home_lists_domain_applications(self):
|
||||||
|
response = self.client.get("/")
|
||||||
|
self.assertNotContains(response, "igorville.gov")
|
||||||
|
site = Website.objects.create(website="igorville.gov")
|
||||||
|
application = DomainApplication.objects.create(
|
||||||
|
creator=self.user, requested_domain=site
|
||||||
|
)
|
||||||
|
response = self.client.get("/")
|
||||||
|
self.assertContains(response, "igorville.gov", count=1)
|
||||||
|
# clean up
|
||||||
|
application.delete()
|
||||||
|
|
||||||
def test_whoami_page(self):
|
def test_whoami_page(self):
|
||||||
"""User information appears on the whoami page."""
|
"""User information appears on the whoami page."""
|
||||||
response = self.client.get("/whoami/")
|
response = self.client.get("/whoami/")
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
from registrar.models import DomainApplication
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
"""This page is available to anyone without logging in."""
|
"""This page is available to anyone without logging in."""
|
||||||
return render(request, "home.html")
|
context = {}
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
applications = DomainApplication.objects.filter(creator=request.user)
|
||||||
|
context["domain_applications"] = applications
|
||||||
|
return render(request, "home.html", context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue