fix current_shift respect registration state

pull/1/head
parent d81f8cbb0d
commit a75baf537a

@ -82,7 +82,12 @@ class Helper(models.Model):
output_field=models.DateTimeField(), output_field=models.DateTimeField(),
) )
) )
.filter(helper=self, shift_end__gte=timezone.now(), shift__deleted=False) .filter(
helper=self,
shift_end__gte=timezone.now(),
shift__deleted=False,
state__in=[ShiftRegistration.REGISTERED, ShiftRegistration.CHECKED_IN],
)
.order_by("shift__start_at") .order_by("shift__start_at")
.first() .first()
) )

Loading…
Cancel
Save