updated host object to not be unique

This commit is contained in:
Alysia Broddrick 2024-01-08 18:52:59 -08:00
parent 1b2f34935a
commit 5fed6d5810
No known key found for this signature in database
GPG key ID: 03917052CD0F06B7
2 changed files with 21 additions and 1 deletions

View file

@ -0,0 +1,17 @@
# Generated by Django 4.2.7 on 2024-01-09 02:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("registrar", "0061_domain_security_contact_registry_id"),
]
operations = [
migrations.AlterField(
model_name="host",
name="name",
field=models.CharField(default=None, help_text="Fully qualified domain name", max_length=253),
),
]

View file

@ -20,7 +20,7 @@ class Host(TimeStampedModel):
null=False,
blank=False,
default=None, # prevent saving without a value
unique=True,
unique=False,
help_text="Fully qualified domain name",
)
@ -30,3 +30,6 @@ class Host(TimeStampedModel):
related_name="host", # access this Host via the Domain as `domain.host`
help_text="Domain to which this host belongs",
)
def __str__(self):
return f"{self.domain.name} {self.name}"