Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Kolego
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Kolego
Commits
66f22cdd
You need to sign in or sign up before continuing.
Commit
66f22cdd
authored
4 months ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Fix handling of new absences cutting existing ones in two halves
parent
4e97b71b
No related branches found
No related tags found
1 merge request
!52
Resolve "Only allow one absence at any point of time"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/kolego/models/absence.py
+3
-1
3 additions, 1 deletion
aleksis/apps/kolego/models/absence.py
with
3 additions
and
1 deletion
aleksis/apps/kolego/models/absence.py
+
3
−
1
View file @
66f22cdd
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment