Fix detecting if peers changed in serializer

Add a check_peers_changed() utility method
to determine if peers in attrs matches
the current instance peers.

Other changes:
- Set ip_address default to "", and do not
allow null.
This commit is contained in:
Seth Foster
2023-08-09 01:16:23 -04:00
committed by Seth Foster
parent c47acc5988
commit 2a0be898e6
3 changed files with 12 additions and 5 deletions

View File

@@ -105,8 +105,7 @@ class Instance(HasPolicyEditsMixin, BaseModel):
hostname = models.CharField(max_length=250, unique=True)
ip_address = models.CharField(
blank=True,
null=True,
default=None,
default="",
max_length=50,
)
# Auto-fields, implementation is different from BaseModel