mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 03:06:01 +02:00
Updated domain model & added migration
This commit is contained in:
parent
cbc648d571
commit
bfb28a62f8
3 changed files with 31 additions and 4 deletions
|
@ -5,6 +5,7 @@ import re
|
|||
from datetime import date
|
||||
from string import digits
|
||||
from typing import Optional
|
||||
|
||||
from django_fsm import FSMField, transition, TransitionNotAllowed # type: ignore
|
||||
|
||||
from django.db import models
|
||||
|
@ -29,6 +30,7 @@ from epplibwrapper import (
|
|||
|
||||
from registrar.models.utility.contact_error import ContactError, ContactErrorCodes
|
||||
|
||||
from django.db.models import DateField
|
||||
from .utility.domain_field import DomainField
|
||||
from .utility.domain_helper import DomainHelper
|
||||
from .utility.time_stamped_model import TimeStampedModel
|
||||
|
@ -209,12 +211,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
return self._get_property("up_date")
|
||||
|
||||
@Cache
|
||||
def expiration_date(self) -> date:
|
||||
def registry_expiration_date(self) -> date:
|
||||
"""Get or set the `ex_date` element from the registry."""
|
||||
return self._get_property("ex_date")
|
||||
|
||||
@expiration_date.setter # type: ignore
|
||||
def expiration_date(self, ex_date: date):
|
||||
@registry_expiration_date.setter # type: ignore
|
||||
def registry_expiration_date(self, ex_date: date):
|
||||
pass
|
||||
|
||||
@Cache
|
||||
|
@ -944,6 +946,11 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
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):
|
||||
return self.state == Domain.State.CREATED
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue