mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-29 07:43:32 +02:00
Merge branch 'main' into dk/996-reports
This commit is contained in:
commit
ddbc32c749
4 changed files with 37 additions and 6 deletions
20
src/registrar/migrations/0043_domain_expiration_date.py
Normal file
20
src/registrar/migrations/0043_domain_expiration_date.py
Normal 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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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 %}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue