mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
updated transition domain and added migration
This commit is contained in:
parent
4d4a14a187
commit
26a059672b
2 changed files with 36 additions and 5 deletions
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 4.2.1 on 2023-09-27 00:18
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("registrar", "0031_transitiondomain_and_more"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="transitiondomain",
|
||||||
|
name="status",
|
||||||
|
field=models.CharField(
|
||||||
|
blank=True,
|
||||||
|
choices=[("ready", "Ready"), ("hold", "Hold")],
|
||||||
|
default="ready",
|
||||||
|
help_text="domain status during the transfer",
|
||||||
|
max_length=255,
|
||||||
|
verbose_name="Status",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -3,15 +3,16 @@ from django.db import models
|
||||||
from .utility.time_stamped_model import TimeStampedModel
|
from .utility.time_stamped_model import TimeStampedModel
|
||||||
|
|
||||||
|
|
||||||
|
class StatusChoices(models.TextChoices):
|
||||||
|
READY = "ready", "Ready"
|
||||||
|
HOLD = "hold", "Hold"
|
||||||
|
|
||||||
|
|
||||||
class TransitionDomain(TimeStampedModel):
|
class TransitionDomain(TimeStampedModel):
|
||||||
"""Transition Domain model stores information about the
|
"""Transition Domain model stores information about the
|
||||||
state of a domain upon transition between registry
|
state of a domain upon transition between registry
|
||||||
providers"""
|
providers"""
|
||||||
|
|
||||||
class StatusChoices(models.TextChoices):
|
|
||||||
CREATED = "created", "Created"
|
|
||||||
HOLD = "hold", "Hold"
|
|
||||||
|
|
||||||
username = models.TextField(
|
username = models.TextField(
|
||||||
null=False,
|
null=False,
|
||||||
blank=False,
|
blank=False,
|
||||||
|
@ -27,6 +28,7 @@ class TransitionDomain(TimeStampedModel):
|
||||||
max_length=255,
|
max_length=255,
|
||||||
null=False,
|
null=False,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
default=StatusChoices.READY,
|
||||||
choices=StatusChoices.choices,
|
choices=StatusChoices.choices,
|
||||||
verbose_name="Status",
|
verbose_name="Status",
|
||||||
help_text="domain status during the transfer",
|
help_text="domain status during the transfer",
|
||||||
|
@ -39,4 +41,9 @@ class TransitionDomain(TimeStampedModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.username
|
return (
|
||||||
|
f"username: {self.username} "
|
||||||
|
f"domainName: {self.domain_name} "
|
||||||
|
f"status: {self.status} "
|
||||||
|
f"email sent: {self.email_sent} "
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue