only update the ip address field on the instance

* The heartbeat of an instance is determined to be the last modified
time of the Instance object. Therefore, we want to be careful to only
update very specific fields of the Instance object.
This commit is contained in:
chris meyers 2020-03-19 09:04:47 -04:00
parent c7de3b0528
commit 0a1070834d

View File

@ -126,7 +126,7 @@ class InstanceManager(models.Manager):
instance = instance.get()
if instance.ip_address != ip_address:
instance.ip_address = ip_address
instance.save()
instance.save(update_fields=['ip_address'])
return (True, instance)
else:
return (False, instance)