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
80ff7052
Verified
Commit
80ff7052
authored
4 years ago
by
Lloyd Meins
Browse files
Options
Downloads
Patches
Plain Diff
Filter for all periods of the same lesson
parent
6ea15d23
No related branches found
No related tags found
1 merge request
!169
Resolve "Lesson topic not carried to previous lesson if entered in second lesson of a block"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/models.py
+2
-30
2 additions, 30 deletions
aleksis/apps/alsijil/models.py
with
2 additions
and
30 deletions
aleksis/apps/alsijil/models.py
+
2
−
30
View file @
80ff7052
...
...
@@ -285,12 +285,11 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
Can be deactivated using site preference ``alsijil__carry_over``.
"""
following_periods
=
LessonPeriod
.
objects
.
filter
(
all_periods_of_lesson
=
LessonPeriod
.
objects
.
filter
(
lesson
=
self
.
lesson_period
.
lesson
,
period__weekday
=
self
.
lesson_period
.
period
.
weekday
,
period__period__gt
=
self
.
lesson_period
.
period
.
period
,
)
for
period
in
following_periods
:
for
period
in
all_periods_of_lesson
:
lesson_documentation
=
period
.
get_or_create_lesson_documentation
(
CalendarWeek
(
week
=
self
.
week
,
year
=
self
.
year
)
)
...
...
@@ -312,33 +311,6 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
if
changed
:
lesson_documentation
.
save
()
if
not
self
.
lesson_period
.
week
:
self
.
lesson_period
.
annotate_week
(
CalendarWeek
(
year
=
self
.
year
,
week
=
self
.
week
))
previous_lesson
=
self
.
lesson_period
.
prev
if
previous_lesson
:
lesson_documentation
=
previous_lesson
.
get_or_create_lesson_documentation
(
CalendarWeek
(
week
=
self
.
week
,
year
=
self
.
year
)
)
changed
=
False
if
not
lesson_documentation
.
topic
:
lesson_documentation
.
topic
=
self
.
topic
changed
=
True
if
not
lesson_documentation
.
homework
:
lesson_documentation
.
homework
=
self
.
homework
changed
=
True
if
not
lesson_documentation
.
group_note
:
lesson_documentation
.
group_note
=
self
.
group_note
changed
=
True
if
changed
:
lesson_documentation
.
save
()
def
__str__
(
self
)
->
str
:
return
f
"
{
self
.
lesson_period
}
,
{
self
.
date_formatted
}
"
...
...
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