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
Commits
2f79cae3
Commit
2f79cae3
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '131-make-carry-over-of-absences-configurable' into 'master'
Resolve "Make carry over of absences configurable" Closes
#131
See merge request
!137
parents
616d414e
ffe66828
No related branches found
No related tags found
1 merge request
!137
Resolve "Make carry over of absences configurable"
Pipeline
#5626
passed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/preferences.py
+8
-0
8 additions, 0 deletions
aleksis/apps/alsijil/preferences.py
aleksis/apps/alsijil/views.py
+13
-11
13 additions, 11 deletions
aleksis/apps/alsijil/views.py
with
21 additions
and
11 deletions
aleksis/apps/alsijil/preferences.py
+
8
−
0
View file @
2f79cae3
...
...
@@ -46,6 +46,14 @@ class CarryOverDataToNextPeriods(BooleanPreference):
help_text
=
_
(
"
This will carry over data only if the data in the following periods are empty.
"
)
@site_preferences_registry.register
class
CarryOverPersonalNotesToNextPeriods
(
BooleanPreference
):
section
=
alsijil
name
=
"
carry_over_personal_notes
"
default
=
True
verbose_name
=
_
(
"
Carry over personal notes to all following lesson periods on the same day.
"
)
@site_preferences_registry.register
class
AllowOpenPeriodsOnSameDay
(
BooleanPreference
):
section
=
alsijil
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
13
−
11
View file @
2f79cae3
...
...
@@ -153,17 +153,19 @@ def lesson(
reversion
.
set_user
(
request
.
user
)
instances
=
personal_note_formset
.
save
()
# Iterate over personal notes and carry changed absences to following lessons
with
reversion
.
create_revision
():
reversion
.
set_user
(
request
.
user
)
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
,
)
if
get_site_preferences
()[
"
alsijil__carry_over_personal_notes
"
]:
# Iterate over personal notes
# and carry changed absences to following lessons
with
reversion
.
create_revision
():
reversion
.
set_user
(
request
.
user
)
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.
"
))
...
...
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