.
This commit is contained in:
+7
-8
@@ -48,15 +48,14 @@ class Worker:
|
||||
if self.end_date > Rota.rota_end_date:
|
||||
self.end_date = Rota.rota_end_date
|
||||
else:
|
||||
days_to_work = (self.end_date - Rota.start_date).days
|
||||
if self.end_date > Rota.start_date:
|
||||
days_to_work = (self.end_date - Rota.start_date).days
|
||||
|
||||
if days_to_work < 0:
|
||||
days_to_work = 0
|
||||
|
||||
# add unavalabilities
|
||||
for weeks_days in Rota.weeks_days_product[days_to_work:]:
|
||||
week, day = weeks_days
|
||||
Rota.unavailable_to_work.add((self.id, week, day))
|
||||
# add unavalabilities
|
||||
for weeks_days in Rota.weeks_days_product[days_to_work:]:
|
||||
week, day = weeks_days
|
||||
Rota.unavailable_to_work.add((self.id, week, day))
|
||||
|
||||
if oop is not None:
|
||||
start_oop, end_oop = oop
|
||||
@@ -67,7 +66,7 @@ class Worker:
|
||||
|
||||
|
||||
# ignore oops if they finish before the rota start date
|
||||
if end_oop_date < Rota.start_date:
|
||||
if end_oop_date > Rota.start_date:
|
||||
if end_oop_date > Rota.rota_end_date:
|
||||
end_oop_date = Rota.rota_end_date
|
||||
|
||||
|
||||
Reference in New Issue
Block a user