mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-19 17:25:56 +02:00
Merge branch 'main' into nmb/user-invitations
This commit is contained in:
commit
c12aa1dd75
5 changed files with 53 additions and 26 deletions
|
@ -1 +1,2 @@
|
|||
from .application_wizard import *
|
||||
from .domain import DomainAddUserForm
|
||||
|
|
21
src/registrar/forms/domain.py
Normal file
21
src/registrar/forms/domain.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
"""Forms for domain management."""
|
||||
|
||||
from django import forms
|
||||
|
||||
from registrar.models import User
|
||||
|
||||
|
||||
class DomainAddUserForm(forms.Form):
|
||||
|
||||
"""Form for adding a user to a domain."""
|
||||
|
||||
email = forms.EmailField(label="Email")
|
||||
|
||||
def clean_email(self):
|
||||
requested_email = self.cleaned_data["email"]
|
||||
try:
|
||||
User.objects.get(email=requested_email)
|
||||
except User.DoesNotExist:
|
||||
# TODO: send an invitation email to a non-existent user
|
||||
raise forms.ValidationError("That user does not exist in this system.")
|
||||
return requested_email
|
|
@ -14,12 +14,18 @@ from .utility import DomainPermission
|
|||
|
||||
|
||||
class DomainView(DomainPermission, DetailView):
|
||||
|
||||
"""Domain detail overview page."""
|
||||
|
||||
model = Domain
|
||||
template_name = "domain_detail.html"
|
||||
context_object_name = "domain"
|
||||
|
||||
|
||||
class DomainUsersView(DomainPermission, DetailView):
|
||||
|
||||
"""User management page in the domain details."""
|
||||
|
||||
model = Domain
|
||||
template_name = "domain_users.html"
|
||||
context_object_name = "domain"
|
||||
|
@ -33,6 +39,13 @@ class DomainAddUserForm(DomainPermission, forms.Form):
|
|||
|
||||
|
||||
class DomainAddUserView(DomainPermission, FormMixin, DetailView):
|
||||
|
||||
"""Inside of a domain's user management, a form for adding users.
|
||||
|
||||
Multiple inheritance is used here for permissions, form handling, and
|
||||
details of the individual domain.
|
||||
"""
|
||||
|
||||
template_name = "domain_add_user.html"
|
||||
model = Domain
|
||||
form_class = DomainAddUserForm
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
10038 OUTOFSCOPE http://app:8080/public/css/.*
|
||||
10038 OUTOFSCOPE http://app:8080/public/js/.*
|
||||
10038 OUTOFSCOPE http://app:8080/(robots.txt|sitemap.xml|TODO|edit/)
|
||||
10038 OUTOFSCOPE http://app:8080/users
|
||||
10038 OUTOFSCOPE http://app:8080/users/add
|
||||
# This URL always returns 404, so include it as well.
|
||||
10038 OUTOFSCOPE http://app:8080/todo
|
||||
# OIDC isn't configured in the test environment and DEBUG=True so this gives a 500 without CSP headers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue