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
!61
Resolve "Do not allow to add personal notes for cancelled lessons"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Do not allow to add personal notes for cancelled lessons"
82-do-not-count-cancelled-lessons
into
master
Overview
1
Commits
9
Pipelines
9
Changes
3
Merged
Jonathan Weth
requested to merge
82-do-not-count-cancelled-lessons
into
master
4 years ago
Overview
1
Commits
9
Pipelines
9
Changes
1
Expand
Closes
#82 (closed)
Edited
4 years ago
by
Jonathan Weth
0
0
Merge request reports
Compare
version 5
version 8
1928e6ea
4 years ago
version 7
068a0cd2
4 years ago
version 6
64c57bb0
4 years ago
version 5
45614af4
4 years ago
version 4
16deaf83
4 years ago
version 3
8f2ac50f
4 years ago
version 2
8f2ac50f
4 years ago
version 1
3cb069cd
4 years ago
master (base)
and
version 6
latest version
22e3f80d
9 commits,
4 years ago
version 8
1928e6ea
8 commits,
4 years ago
version 7
068a0cd2
7 commits,
4 years ago
version 6
64c57bb0
6 commits,
4 years ago
version 5
45614af4
5 commits,
4 years ago
version 4
16deaf83
3 commits,
4 years ago
version 3
8f2ac50f
2 commits,
4 years ago
version 2
8f2ac50f
4 commits,
4 years ago
version 1
3cb069cd
2 commits,
4 years ago
Show latest version
1 file
+
0
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
aleksis/apps/alsijil/views.py
+
19
−
13
Options
@@ -14,12 +14,13 @@ from reversion.views import RevisionMixin
from
rules.contrib.views
import
PermissionRequiredMixin
from
aleksis.apps.chronos.managers
import
TimetableType
from
aleksis.apps.chronos.models
import
LessonPeriod
from
aleksis.apps.chronos.models
import
LessonPeriod
,
LessonSubstitution
from
aleksis.apps.chronos.util.chronos_helpers
import
get_el_by_pk
from
aleksis.apps.chronos.util.date
import
week_weekday_to_date
from
aleksis.core.mixins
import
AdvancedCreateView
,
AdvancedDeleteView
,
AdvancedEditView
from
aleksis.core.models
import
Group
,
Person
,
SchoolTerm
from
aleksis.core.util
import
messages
from
aleksis.core.util.core_helpers
import
get_site_preferences
from
.forms
import
(
ExcuseTypeForm
,
@@ -114,18 +115,23 @@ def lesson(
messages
.
success
(
request
,
_
(
"
The lesson documentation has been saved.
"
))
if
personal_note_formset
.
is_valid
():
instances
=
personal_note_formset
.
save
()
# Iterate over personal notes and carry changed absences to following lessons
for
instance
in
instances
:
instance
.
person
.
mark_absent
(
wanted_week
[
lesson_period
.
period
.
weekday
],
lesson_period
.
period
.
period
+
1
,
instance
.
absent
,
instance
.
excused
,
instance
.
excuse_type
,
)
substitution
=
lesson_period
.
get_substitution
()
if
(
not
getattr
(
substitution
,
"
cancelled
"
,
False
)
or
not
get_site_preferences
()[
"
alsijil__block_personal_notes_for_cancelled
"
]
):
if
personal_note_formset
.
is_valid
():
instances
=
personal_note_formset
.
save
()
# Iterate over personal notes and carry changed absences to following lessons
for
instance
in
instances
:
instance
.
person
.
mark_absent
(
wanted_week
[
lesson_period
.
period
.
weekday
],
lesson_period
.
period
.
period
+
1
,
instance
.
absent
,
instance
.
excused
,
instance
.
excuse_type
,
)
messages
.
success
(
request
,
_
(
"
The personal notes have been saved.
"
))
Loading