def update(self, instance: RRset, validated_data): rrs_data = validated_data.pop('records', None) if rrs_data is not None: self._set_all_record_contents(instance, rrs_data) ttl = validated_data.pop('ttl', None) if ttl and instance.ttl != ttl: instance.ttl = ttl instance.save() return instance
def update(self, instance: models.RRset, validated_data): rrs_data = validated_data.pop('records', None) if rrs_data is not None: self._set_all_record_contents(instance, rrs_data) ttl = validated_data.pop('ttl', None) if ttl and instance.ttl != ttl: instance.ttl = ttl instance.save() # also updates instance.touched else: # Update instance.touched without triggering post-save signal (no pdns action required) models.RRset.objects.filter(pk=instance.pk).update(touched=timezone.now()) return instance