|
|
|
@ -57,12 +57,16 @@ class Shift(models.Model):
|
|
|
|
|
return (self.start_at <= timezone.now()) and (not self.has_ended())
|
|
|
|
|
|
|
|
|
|
def registration_count(self):
|
|
|
|
|
return self.shiftregistration_set.filter(
|
|
|
|
|
state__in=[
|
|
|
|
|
ShiftRegistration.RegState.REGISTERED,
|
|
|
|
|
ShiftRegistration.RegState.CHECKED_IN,
|
|
|
|
|
]
|
|
|
|
|
).count()
|
|
|
|
|
return (
|
|
|
|
|
self.reg_count
|
|
|
|
|
if hasattr(self, "reg_count")
|
|
|
|
|
else self.shiftregistration_set.filter(
|
|
|
|
|
state__in=[
|
|
|
|
|
ShiftRegistration.RegState.REGISTERED,
|
|
|
|
|
ShiftRegistration.RegState.CHECKED_IN,
|
|
|
|
|
]
|
|
|
|
|
).count()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Helper(models.Model):
|
|
|
|
|