Check-in list editor: Allow to delete last rule

This commit is contained in:
Raphael Michel
2021-04-21 12:56:28 +02:00
parent caa61a463e
commit 99bc133540
2 changed files with 6 additions and 1 deletions

View File

@@ -225,6 +225,11 @@ class CheckinList(LoggedModel):
for v in values:
cls.validate_rules(v, seen_nonbool=seen_nonbool or operator not in ('or', 'and'), depth=depth + 1)
if operator in ('or', 'and') and depth == 0 and not values:
return {}
return rules
class Checkin(models.Model):
"""