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
c51ad4a5
Commit
c51ad4a5
authored
2 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Fix linting issues
parent
2d6f359e
No related branches found
No related tags found
No related merge requests found
Pipeline
#84741
passed
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/menus.py
+1
-1
1 addition, 1 deletion
aleksis/apps/alsijil/menus.py
aleksis/apps/alsijil/views.py
+15
-15
15 additions, 15 deletions
aleksis/apps/alsijil/views.py
with
16 additions
and
16 deletions
aleksis/apps/alsijil/menus.py
+
1
−
1
View file @
c51ad4a5
...
...
@@ -23,7 +23,7 @@ MENUS = {
"
aleksis.core.util.predicates.permission_validator
"
,
"
alsijil.view_coursebook_rule
"
,
),
]
]
,
},
{
"
name
"
:
_
(
"
Current lesson
"
),
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
15
−
15
View file @
c51ad4a5
...
...
@@ -37,7 +37,11 @@ from aleksis.apps.chronos.models import (
TimePeriod
,
)
from
aleksis.apps.chronos.util.build
import
build_weekdays
from
aleksis.apps.chronos.util.date
import
get_current_year
,
get_weeks_for_year
,
week_weekday_to_date
from
aleksis.apps.chronos.util.date
import
(
get_current_year
,
get_weeks_for_year
,
week_weekday_to_date
,
)
from
aleksis.core.mixins
import
(
AdvancedCreateView
,
AdvancedDeleteView
,
...
...
@@ -1473,29 +1477,25 @@ class SelectCoursebookView(PermissionRequiredMixin, TemplateView):
# Show all future and the ones of last week
last_week
,
last_week_year
=
(
current_week
-
1
,
current_year
)
if
current_week
>=
2
else
(
CalendarWeek
.
get_last_week_of_year
(
current_year
-
1
),
current_year
-
1
(
current_week
-
1
,
current_year
)
if
current_week
>=
2
else
(
CalendarWeek
.
get_last_week_of_year
(
current_year
-
1
),
current_year
-
1
)
)
last_week_query
=
Q
(
lesson_periods__substitutions__week
=
last_week
,
lesson_periods__substitutions__year
=
last_week_year
lesson_periods__substitutions__year
=
last_week_year
,
)
this_week_query
=
Q
(
lesson_periods__substitutions__week__gte
=
current_week
,
lesson_periods__substitutions__year
=
current_year
)
next_year_query
=
Q
(
lesson_periods__substitutions__year__gt
=
current_year
lesson_periods__substitutions__year
=
current_year
,
)
next_year_query
=
Q
(
lesson_periods__substitutions__year__gt
=
current_year
)
context
[
"
lessons
"
]
=
Lesson
.
objects
.
filter
(
Q
(
teachers
=
person
)
|
(
Q
(
lesson_periods__substitutions__teachers
=
person
)
&
(
last_week_query
|
this_week_query
|
next_year_query
)
Q
(
teachers
=
person
)
|
(
Q
(
lesson_periods__substitutions__teachers
=
person
)
&
(
last_week_query
|
this_week_query
|
next_year_query
)
)
).
for_current_or_all
()
return
context
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