2
0
Fork 0

update can_cancel to respect reservation state

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-05-10 22:15:02 +02:00
parent 19623fdb92
commit d81f8cbb0d
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ class ShiftRegistration(models.Model):
) )
def can_cancel(self): def can_cancel(self):
if self.state != self.REGISTERED:
return false
return self.shift.start_at > ( return self.shift.start_at > (
timezone.now() timezone.now()
+ global_preferences_registry.manager()["helper__min_cancel_time"] + global_preferences_registry.manager()["helper__min_cancel_time"]