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
5914e36b
Verified
Commit
5914e36b
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix terminology
parent
10c43d74
No related branches found
No related tags found
1 merge request
!79
Resolve "Carry over the data of the first lesson for double (or triple, ...) lessons"
Pipeline
#3390
passed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/models.py
+8
-8
8 additions, 8 deletions
aleksis/apps/alsijil/models.py
aleksis/apps/alsijil/preferences.py
+4
-4
4 additions, 4 deletions
aleksis/apps/alsijil/preferences.py
with
12 additions
and
12 deletions
aleksis/apps/alsijil/models.py
+
8
−
8
View file @
5914e36b
...
...
@@ -106,21 +106,21 @@ class LessonDocumentation(ExtensibleModel):
verbose_name
=
_
(
"
Group note
"
),
max_length
=
200
,
blank
=
True
)
def
_
take
_over_data
(
self
):
"""
Take
over data to the next lesson, if exists and data are not already set.
def
_
carry
_over_data
(
self
):
"""
Carry
over data to the next lesson, if exists and data are not already set.
Can be deactivated using site preference ``alsijil__
take_over_double
``.
Can be deactivated using site preference ``alsijil__
carry_over
``.
"""
if
get_site_preferences
()[
"
alsijil__
take_over_double
"
]
and
(
if
get_site_preferences
()[
"
alsijil__
carry_over
"
]
and
(
self
.
topic
or
self
.
homework
or
self
.
group_note
):
try
:
second_
lesson
=
LessonPeriod
.
objects
.
get
(
second_
period
=
LessonPeriod
.
objects
.
get
(
lesson
=
self
.
lesson_period
.
lesson
,
period__weekday
=
self
.
lesson_period
.
period
.
weekday
,
period__period
=
self
.
lesson_period
.
period
.
period
+
1
,
)
lesson_documentation
=
second_
lesson
.
get_or_create_lesson_documentation
(
lesson_documentation
=
second_
period
.
get_or_create_lesson_documentation
(
CalendarWeek
(
week
=
self
.
week
,
year
=
self
.
lesson_period
.
lesson
.
get_year
(
self
.
week
),
...
...
@@ -144,11 +144,11 @@ class LessonDocumentation(ExtensibleModel):
if
changed
:
lesson_documentation
.
save
()
except
LessonPeriod
.
DoesNotExist
:
# Do nothing if it's a single
lesson
# Do nothing if it's a single
period
pass
def
save
(
self
,
*
args
,
**
kwargs
):
self
.
_
take
_over_data
()
self
.
_
carry
_over_data
()
super
().
save
(
*
args
,
**
kwargs
)
class
Meta
:
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/preferences.py
+
4
−
4
View file @
5914e36b
...
...
@@ -17,13 +17,13 @@ class BlockPersonalNotesForCancelled(BooleanPreference):
@site_preferences_registry.register
class
Take
OverData
ForDoubleLesson
s
(
BooleanPreference
):
class
Carry
OverData
ToNextPeriod
s
(
BooleanPreference
):
section
=
alsijil
name
=
"
take_over_double
"
name
=
"
carry_over
"
default
=
True
verbose_name
=
_
(
"
Take
over data from first lesson
for second lesson in double lesson
s
"
"
Carry
over data from first lesson
period to the following lesson periods in lessons over multiple period
s
"
)
help_text
=
_
(
"
This will
take
over data only if the data in the
second lesson
are empty.
"
"
This will
carry
over data only if the data in the
following periods
are empty.
"
)
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