mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-31 15:06:32 +02:00
Create a DraftDomain model for requested domains
This commit is contained in:
parent
93427ad072
commit
7a3e1bcb2c
15 changed files with 272 additions and 124 deletions
|
@ -5,7 +5,7 @@ from faker import Faker
|
|||
from registrar.models import (
|
||||
User,
|
||||
DomainApplication,
|
||||
Domain,
|
||||
DraftDomain,
|
||||
Contact,
|
||||
Website,
|
||||
)
|
||||
|
@ -216,11 +216,13 @@ class DomainApplicationFixture:
|
|||
|
||||
if not da.requested_domain:
|
||||
if "requested_domain" in app and app["requested_domain"] is not None:
|
||||
da.requested_domain, _ = Domain.objects.get_or_create(
|
||||
da.requested_domain, _ = DraftDomain.objects.get_or_create(
|
||||
name=app["requested_domain"]
|
||||
)
|
||||
else:
|
||||
da.requested_domain = Domain.objects.create(name=cls.fake_dot_gov())
|
||||
da.requested_domain = DraftDomain.objects.create(
|
||||
name=cls.fake_dot_gov()
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _set_many_to_many_relations(cls, da: DomainApplication, app: dict):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue