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
e0c8fea0
Verified
Commit
e0c8fea0
authored
5 years ago
by
mirabilos
Committed by
mirabilos
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Check for missing lesson_period even earlier.
parent
ec861d0d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biscuit/apps/alsijil/views.py
+4
-4
4 additions, 4 deletions
biscuit/apps/alsijil/views.py
with
4 additions
and
4 deletions
biscuit/apps/alsijil/views.py
+
4
−
4
View file @
e0c8fea0
...
...
@@ -29,14 +29,14 @@ def lesson(request: HttpRequest, week: Optional[int] = None, period_id: Optional
Q
(
substitutions__teachers
=
request
.
user
.
person
)
|
Q
(
lesson__teachers
=
request
.
user
.
person
)).
first
()
wanted_week
=
current_week
()
context
[
'
lesson_period
'
]
=
lesson_period
context
[
'
week
'
]
=
wanted_week
context
[
'
day
'
]
=
week_days
(
wanted_week
)[
lesson_period
.
period
.
weekday
]
if
not
lesson_period
:
#XXX TODO: nice error page (“no lesson currently running for you?” or so)
return
HttpResponseNotFound
(
"
no current lesson found for you
"
)
context
[
'
lesson_period
'
]
=
lesson_period
context
[
'
week
'
]
=
wanted_week
context
[
'
day
'
]
=
week_days
(
wanted_week
)[
lesson_period
.
period
.
weekday
]
# Create or get lesson documentation object; can be empty when first opening lesson
lesson_documentation
,
created
=
LessonDocumentation
.
objects
.
get_or_create
(
lesson_period
=
lesson_period
,
week
=
wanted_week
)
...
...
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