Merge pull request #715 from cisagov/sspj/remove-whoami

Remove whoami page
This commit is contained in:
Seamus Johnston 2023-06-16 16:37:28 +00:00 committed by GitHub
commit 72184773b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2 additions and 38 deletions

View file

@ -1,14 +1,11 @@
{ {
"defaults": { "defaults": {
"concurrency": 1, "concurrency": 1,
"timeout": 30000, "timeout": 30000
"hideElements": "a[href='/whoami/']"
}, },
"urls": [ "urls": [
"http://localhost:8080/", "http://localhost:8080/",
"http://localhost:8080/health/", "http://localhost:8080/health/",
"http://localhost:8080/whoami/",
"http://localhost:8080/register/", "http://localhost:8080/register/",
"http://localhost:8080/register/organization/", "http://localhost:8080/register/organization/",
"http://localhost:8080/register/org_federal/", "http://localhost:8080/register/org_federal/",

View file

@ -45,7 +45,6 @@ for step, view in [
urlpatterns = [ urlpatterns = [
path("", views.index, name="home"), path("", views.index, name="home"),
path("whoami/", views.whoami, name="whoami"),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path( path(
"application/<id>/edit/", "application/<id>/edit/",

View file

@ -152,7 +152,7 @@
<ul class="usa-nav__primary usa-accordion"> <ul class="usa-nav__primary usa-accordion">
<li class="usa-nav__primary-item"> <li class="usa-nav__primary-item">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="{% url 'whoami' %}"><span>{{ user.email }}</span></a> <span>{{ user.email }}</span>
</li> </li>
<li class="usa-nav__primary-item display-flex flex-align-center"> <li class="usa-nav__primary-item display-flex flex-align-center">
<span class="text-base"> | </span> <span class="text-base"> | </span>

View file

@ -1,10 +0,0 @@
{% extends 'base.html' %}
{% block title %} Hello {% endblock %}
{% block content %}
<main id="main-content" class="grid-container">
<p> Hello {{ user.last_name|default:"No last name given" }}, {{ user.first_name|default:"No first name given" }} &lt;{{ user.email }}&gt;! </p>
<p><a href="{% url 'logout' %}">Click here to log out</a></p>
</main>
{% endblock %}

View file

@ -40,12 +40,6 @@ class TestViews(TestCase):
response = self.client.get("/") response = self.client.get("/")
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
def test_whoami_page_no_user(self):
"""Whoami page not accessible without a logged-in user."""
response = self.client.get("/whoami/")
self.assertEqual(response.status_code, 302)
self.assertIn("?next=/whoami/", response.headers["Location"])
def test_application_form_not_logged_in(self): def test_application_form_not_logged_in(self):
"""Application form not accessible without a logged-in user.""" """Application form not accessible without a logged-in user."""
response = self.client.get("/register/") response = self.client.get("/register/")
@ -100,13 +94,6 @@ class LoggedInTests(TestWithUser):
# clean up # clean up
role.delete() role.delete()
def test_whoami_page(self):
"""User information appears on the whoami page."""
response = self.client.get("/whoami/")
self.assertContains(response, self.user.first_name)
self.assertContains(response, self.user.last_name)
self.assertContains(response, self.user.email)
def test_application_form_view(self): def test_application_form_view(self):
response = self.client.get("/register/", follow=True) response = self.client.get("/register/", follow=True)
self.assertContains( self.assertContains(

View file

@ -12,4 +12,3 @@ from .domain import (
) )
from .health import * from .health import *
from .index import * from .index import *
from .whoami import *

View file

@ -1,8 +0,0 @@
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required
def whoami(request):
"""This is the first page someone goes to after logging in."""
return render(request, "whoami.html")