mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-10 06:24:45 +02:00
Review feedback: logging, name changes
This commit is contained in:
parent
f66df2c931
commit
ac73a54a9d
4 changed files with 10 additions and 3 deletions
|
@ -476,7 +476,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
try:
|
try:
|
||||||
send_templated_email(
|
send_templated_email(
|
||||||
"emails/submission_confirmation.txt",
|
"emails/submission_confirmation.txt",
|
||||||
"emails/submission_confirmation.subject.txt",
|
"emails/submission_confirmation_subject.txt",
|
||||||
self.submitter.email,
|
self.submitter.email,
|
||||||
context={"id": self.id, "domain_name": self.requested_domain.name},
|
context={"id": self.id, "domain_name": self.requested_domain.name},
|
||||||
)
|
)
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
</svg><span class="margin-left-05">Add another user</span>
|
</svg><span class="margin-left-05">Add another user</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% if domain.invitations.all %}
|
{% if domain.invitations.exists %}
|
||||||
<h2>Invitations</h2>
|
<h2>Invitations</h2>
|
||||||
<table class="usa-table usa-table--borderless usa-table--stacked dotgov-table--stacked dotgov-table">
|
<table class="usa-table usa-table--borderless usa-table--stacked dotgov-table--stacked dotgov-table">
|
||||||
<caption class="sr-only">Domain invitations</caption>
|
<caption class="sr-only">Domain invitations</caption>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
"""View for a single Domain."""
|
"""View for a single Domain."""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
from django.db import IntegrityError
|
from django.db import IntegrityError
|
||||||
|
@ -15,6 +17,9 @@ from ..utility.email import send_templated_email, EmailSendingError
|
||||||
from .utility import DomainPermission
|
from .utility import DomainPermission
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DomainView(DomainPermission, DetailView):
|
class DomainView(DomainPermission, DetailView):
|
||||||
|
|
||||||
"""Domain detail overview page."""
|
"""Domain detail overview page."""
|
||||||
|
@ -79,7 +84,7 @@ class DomainAddUserView(DomainPermission, FormMixin, DetailView):
|
||||||
try:
|
try:
|
||||||
send_templated_email(
|
send_templated_email(
|
||||||
"emails/domain_invitation.txt",
|
"emails/domain_invitation.txt",
|
||||||
"emails/domain_invitation.subject.txt",
|
"emails/domain_invitation_subject.txt",
|
||||||
to_address=email_address,
|
to_address=email_address,
|
||||||
context={
|
context={
|
||||||
"domain_url": self._domain_abs_url(),
|
"domain_url": self._domain_abs_url(),
|
||||||
|
@ -88,6 +93,8 @@ class DomainAddUserView(DomainPermission, FormMixin, DetailView):
|
||||||
)
|
)
|
||||||
except EmailSendingError:
|
except EmailSendingError:
|
||||||
messages.warning(self.request, "Could not send email invitation.")
|
messages.warning(self.request, "Could not send email invitation.")
|
||||||
|
logger.warn("Could not sent email invitation to %s for domain %s",
|
||||||
|
email_address, self.object, exc_info=True)
|
||||||
else:
|
else:
|
||||||
messages.success(
|
messages.success(
|
||||||
self.request, f"Invited {email_address} to this domain."
|
self.request, f"Invited {email_address} to this domain."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue