Skip to content

Commit

Permalink
Fix in attendance_template_history_reconstruction_service.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Theophile-Madet committed Nov 20, 2024
1 parent dec29f1 commit 366d1a6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ def reconstruct_from_create_log_entry(
fake_time = last_log_entry.created_date

fake_attendance_template = ShiftAttendanceTemplate()
fake_slot_template = False
if (
hasattr(create_log_entry, "slot_template")
and create_log_entry.slot_template
):
fake_attendance_template.slot_template = create_log_entry.slot_template
else:
fake_slot_template = True
fake_attendance_template.slot_template = ShiftSlotTemplate()
fake_attendance_template.slot_template.name = (
CreateShiftAttendanceTemplateLogEntry.slot_template_name
Expand All @@ -97,6 +99,8 @@ def reconstruct_from_create_log_entry(
shift_attendance_template=fake_attendance_template,
comment="Reconstructed on 20.11.24",
)
if fake_slot_template:
delete_log_entry.slot_template = None
if dry_run:
ic(
"Would create",
Expand Down

0 comments on commit 366d1a6

Please sign in to comment.