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
6440c8a2
Verified
Commit
6440c8a2
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Allow teachers to open lesson periods in the future if they are on the same day
parent
f29159e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!83
Resolve "Allow teachers opening lessons on the same day before they start"
Pipeline
#3463
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/preferences.py
+13
-0
13 additions, 0 deletions
aleksis/apps/alsijil/preferences.py
aleksis/apps/alsijil/views.py
+4
-0
4 additions, 0 deletions
aleksis/apps/alsijil/views.py
with
17 additions
and
0 deletions
aleksis/apps/alsijil/preferences.py
+
13
−
0
View file @
6440c8a2
...
...
@@ -27,3 +27,16 @@ 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
AllowOpenPeriodsOnSameDay
(
BooleanPreference
):
section
=
alsijil
name
=
"
open_periods_same_day
"
default
=
False
verbose_name
=
_
(
"
Allow teachers to open lesson periods on the same day and not just at the beginning of the period
"
)
help_text
=
_
(
"
Lessons in the past are not affected by this setting, you can open them whenever you want.
"
)
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
4
−
0
View file @
6440c8a2
...
...
@@ -83,6 +83,10 @@ def lesson(
wanted_week
[
lesson_period
.
period
.
weekday
],
lesson_period
.
period
.
time_start
,
)
>
datetime
.
now
()
and
not
(
get_site_preferences
()[
"
alsijil__open_periods_same_day
"
]
and
wanted_week
[
lesson_period
.
period
.
weekday
]
<=
datetime
.
now
().
date
()
)
and
not
request
.
user
.
is_superuser
):
raise
PermissionDenied
(
...
...
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