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

Fix handling of new absences outside of existing ones

parent 94361e86
No related branches found
No related tags found
1 merge request!52Resolve "Only allow one absence at any point of time"
......@@ -220,6 +220,7 @@ class Absence(FreeBusy):
event_within.delete()
elif (
new_datetime_start > event_within_datetime_start
and new_datetime_start < event_within_datetime_end
and new_datetime_end >= event_within_datetime_end
):
# Cut end of existing event
......@@ -228,6 +229,7 @@ class Absence(FreeBusy):
elif (
new_datetime_start <= event_within_datetime_start
and new_datetime_end < event_within_datetime_end
and new_datetime_end > event_within_datetime_start
):
# Cut start of existing event
event_within.datetime_start = new_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