2
0
Fork 0

fix current_shift respect registration state

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-05-10 22:47:35 +02:00
parent d81f8cbb0d
commit a75baf537a
1 changed files with 6 additions and 1 deletions

View File

@ -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()
) )