mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-31 09:43:54 +02:00
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:
commit
bf4cb7bedb
11 changed files with 189 additions and 48 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue