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