Skip to content
Snippets Groups Projects
Commit 66f22cdd authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Fix handling of new absences cutting existing ones in two halves

parent 4e97b71b
No related branches found
No related tags found
1 merge request!52Resolve "Only allow one absence at any point of time"
......@@ -190,10 +190,12 @@ class Absence(FreeBusy):
# First, cut end date of existing one
event_within.datetime_end = new_datetime_start
event_within.save(skip_overlap_handling=True)
# Then, create new event filling up the remaining time span
# Then, create new event based on existing one filling up the remaining time
end_filler_event = event_within
end_filler_event.pk = None
end_filler_event.id = None
end_filler_event.calendarevent_ptr_id = None
end_filler_event.freebusy_ptr_id = None
end_filler_event._state.adding = True
end_filler_event.datetime_start = new_datetime_end
end_filler_event.datetime_end = event_within_datetime_end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment