diff --git a/shifts.py b/shifts.py index e84e93b..0608c51 100644 --- a/shifts.py +++ b/shifts.py @@ -651,9 +651,9 @@ class RotaBuilder(object): worker.fte_adj) if self.use_previous_shifts: - if shift in worker.previous_shifts: - worked, allocated = worker.previous_shifts[shift] - target_shifts = target_shifts + allocated - worked + if shift.name in worker.previous_shifts: + worked, allocated = worker.previous_shifts[shift.name] + target_shifts = target_shifts + float(allocated) - float(worked) worker.shift_target_number[shift.name] = target_shifts