Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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-Alsijil
Merge requests
!81
Do not create personal notes for cancelled lesson periods in mark_absent
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Do not create personal notes for cancelled lesson periods in mark_absent
fix/do-not-create-personal-notes-cancelled-lesson-periods
into
master
Overview
6
Commits
3
Pipelines
3
Changes
1
All threads resolved!
Hide all comments
Merged
Jonathan Weth
requested to merge
fix/do-not-create-personal-notes-cancelled-lesson-periods
into
master
4 years ago
Overview
6
Commits
3
Pipelines
3
Changes
1
All threads resolved!
Hide all comments
Expand
0
0
Merge request reports
Compare
master
version 2
147b4304
4 years ago
version 1
303617e9
4 years ago
master (base)
and
latest version
latest version
7e69152f
3 commits,
4 years ago
version 2
147b4304
2 commits,
4 years ago
version 1
303617e9
1 commit,
4 years ago
1 file
+
8
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
aleksis/apps/alsijil/model_extensions.py
+
8
−
2
Options
@@ -37,8 +37,10 @@ def mark_absent(
wanted_week
=
CalendarWeek
.
from_date
(
day
)
# Get all lessons of this person on the specified day
lesson_periods
=
self
.
lesson_periods_as_participant
.
on_day
(
day
).
filter
(
period__period__gte
=
from_period
lesson_periods
=
(
self
.
lesson_periods_as_participant
.
on_day
(
day
)
.
filter
(
period__period__gte
=
from_period
)
.
annotate_week
(
wanted_week
)
)
if
to_period
:
@@ -46,6 +48,10 @@ def mark_absent(
# Create and update all personal notes for the discovered lesson periods
for
lesson_period
in
lesson_periods
:
sub
=
lesson_period
.
get_substitution
()
if
sub
and
sub
.
is_cancelled
:
continue
with
reversion
.
create_revision
():
personal_note
,
created
=
PersonalNote
.
objects
.
update_or_create
(
person
=
self
,
Loading