Skip to content

Commit

Permalink
Reformat how Black likes it.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccacremona committed Jan 8, 2024
1 parent 7f65306 commit 5cf3d2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3474,7 +3474,10 @@ def inc_export_fails(self):
orig = self.export_fails
Casebook.objects.filter(id=self.id).update(export_fails=F("export_fails") + 1)
self.refresh_from_db()
if orig < settings.MAX_EXPORT_ATTEMPTS and self.export_fails >= settings.MAX_EXPORT_ATTEMPTS:
if (
orig < settings.MAX_EXPORT_ATTEMPTS
and self.export_fails >= settings.MAX_EXPORT_ATTEMPTS
):
message = f"Export of casebook {self.id} ({self.title}) has failed the maximum allowed times.\n\nPlease investigate, and reset to zero if the failures were spurious."
send_mail(
f"Export of H2O Casebook {self.id} is frozen.",
Expand Down

0 comments on commit 5cf3d2b

Please sign in to comment.