Add power record status chip, checklist status chip displays number of checklists

This commit is contained in:
2023-05-16 16:01:27 +01:00
parent 06137ab180
commit 51ff06fadd
2 changed files with 17 additions and 7 deletions

View File

@@ -409,7 +409,15 @@ class Event(models.Model, RevisionMixin):
@property
def hs_done(self):
return self.riskassessment is not None and len(self.checklists.all()) > 0
return self.riskassessment is not None and self.has_checklist and self.has_power
@property
def has_checklist(self):
return self.checklists.exists()
@property
def has_power(self):
return self.power_tests.exists()
@property
def has_start_time(self):