Merge branch 'main' into dk/996-reports

This commit is contained in:
David Kennedy 2023-10-29 07:02:37 -04:00
commit ddbc32c749
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
4 changed files with 37 additions and 6 deletions

View file

@ -0,0 +1,20 @@
# Generated by Django 4.2.6 on 2023-10-27 19:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("registrar", "0042_create_groups_v03"),
]
operations = [
migrations.AddField(
model_name="domain",
name="expiration_date",
field=models.DateField(
help_text="Duplication of registry's expiration date saved for ease of reporting",
null=True,
),
),
]

View file

@ -5,6 +5,7 @@ import re
from datetime import date from datetime import date
from string import digits from string import digits
from typing import Optional from typing import Optional
from django_fsm import FSMField, transition, TransitionNotAllowed # type: ignore from django_fsm import FSMField, transition, TransitionNotAllowed # type: ignore
from django.db import models from django.db import models
@ -29,6 +30,7 @@ from epplibwrapper import (
from registrar.models.utility.contact_error import ContactError, ContactErrorCodes from registrar.models.utility.contact_error import ContactError, ContactErrorCodes
from django.db.models import DateField
from .utility.domain_field import DomainField from .utility.domain_field import DomainField
from .utility.domain_helper import DomainHelper from .utility.domain_helper import DomainHelper
from .utility.time_stamped_model import TimeStampedModel from .utility.time_stamped_model import TimeStampedModel
@ -209,12 +211,12 @@ class Domain(TimeStampedModel, DomainHelper):
return self._get_property("up_date") return self._get_property("up_date")
@Cache @Cache
def expiration_date(self) -> date: def registry_expiration_date(self) -> date:
"""Get or set the `ex_date` element from the registry.""" """Get or set the `ex_date` element from the registry."""
return self._get_property("ex_date") return self._get_property("ex_date")
@expiration_date.setter # type: ignore @registry_expiration_date.setter # type: ignore
def expiration_date(self, ex_date: date): def registry_expiration_date(self, ex_date: date):
pass pass
@Cache @Cache
@ -944,6 +946,13 @@ class Domain(TimeStampedModel, DomainHelper):
help_text="Very basic info about the lifecycle of this domain object", help_text="Very basic info about the lifecycle of this domain object",
) )
expiration_date = DateField(
null=True,
help_text=(
"Duplication of registry's expiration" "date saved for ease of reporting"
),
)
def isActive(self): def isActive(self):
return self.state == Domain.State.CREATED return self.state == Domain.State.CREATED

View file

@ -12,11 +12,13 @@
email, and DNS name servers. email, and DNS name servers.
</p> </p>
<ul> <ul class="usa-list">
<li>There is no limit to the number of domain managers you can add.</li> <li>There is no limit to the number of domain managers you can add.</li>
<li>After adding a domain manager, an email invitation will be sent to that user with <li>After adding a domain manager, an email invitation will be sent to that user with
instructions on how to set up an account.</li> instructions on how to set up an account.</li>
<li>To remove a domain manager, <a href="{% public_site_url 'contact/' %}" class="usa-link">contact us</a> for assistance. <li>To remove a domain manager, <a href="{% public_site_url 'contact/' %}"
target="_blank" rel="noopener noreferrer" class="usa-link">contact us</a> for
assistance.</li>
</ul> </ul>
{% if domain.permissions %} {% if domain.permissions %}

View file

@ -56,7 +56,7 @@ class TestDomainCache(MockEppLib):
self.assertFalse("avail" in domain._cache.keys()) self.assertFalse("avail" in domain._cache.keys())
# using a setter should clear the cache # using a setter should clear the cache
domain.expiration_date = datetime.date.today() domain.registry_expiration_date = datetime.date.today()
self.assertEquals(domain._cache, {}) self.assertEquals(domain._cache, {})
# send should have been called only once # send should have been called only once