Merge pull request #1492 from cisagov/dk/1410-display-expiration

Issue #1410 and #1267 - display expiration date and update domain creation date
This commit is contained in:
dave-kennedy-ecs 2023-12-27 13:13:33 -05:00 committed by GitHub
commit bf4cb7bedb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 189 additions and 48 deletions

View file

@ -6,6 +6,7 @@ import logging
from django.apps import apps
from django.db import models
from django_fsm import FSMField, transition # type: ignore
from django.utils import timezone
from registrar.models.domain import Domain
from .utility.time_stamped_model import TimeStampedModel
@ -547,6 +548,14 @@ class DomainApplication(TimeStampedModel):
help_text="Acknowledged .gov acceptable use policy",
)
# submission date records when application is submitted
submission_date = models.DateField(
null=True,
blank=True,
default=None,
help_text="Date submitted",
)
def __str__(self):
try:
if self.requested_domain and self.requested_domain.name:
@ -612,6 +621,10 @@ class DomainApplication(TimeStampedModel):
if not DraftDomain.string_could_be_domain(self.requested_domain.name):
raise ValueError("Requested domain is not a valid domain name.")
# Update submission_date to today
self.submission_date = timezone.now().date()
self.save()
self._send_status_update_email(
"submission confirmation",
"emails/submission_confirmation.txt",