Stop DatabaseError exception when update_fields hasn't been changed

This commit is contained in:
sadnub 2021-09-23 12:56:27 -04:00 committed by GitHub
parent ce56afbdf9
commit 007be5bf95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -457,7 +457,7 @@ class Check(BaseAuditModel):
elif self.status == "passing": elif self.status == "passing":
self.fail_count = 0 self.fail_count = 0
self.save(update_fields=["status", "fail_count", "alert_severity"]) self.save()
if Alert.objects.filter(assigned_check=self, resolved=False).exists(): if Alert.objects.filter(assigned_check=self, resolved=False).exists():
Alert.handle_alert_resolve(self) Alert.handle_alert_resolve(self)