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
Merge requests
!49
Resolve "Add rules and permissions"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Add rules and permissions"
73-add-rules-and-permissions
into
master
Overview
72
Commits
106
Pipelines
85
Changes
1
Merged
Jonathan Weth
requested to merge
73-add-rules-and-permissions
into
master
4 years ago
Overview
72
Commits
106
Pipelines
85
Changes
1
Expand
Closes
#73 (closed)
Closes
#79 (closed)
Edited
4 years ago
by
Nik | Klampfradler
0
0
Merge request reports
Viewing commit
2011793a
Prev
Next
Show latest version
1 file
+
2
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
2011793a
Add tooltips in alsijil_helpers.py
· 2011793a
Hangzhi Yu
authored
4 years ago
aleksis/apps/alsijil/util/alsijil_helpers.py
+
2
−
0
Options
@@ -18,6 +18,7 @@ def get_lesson_period_by_pk(
week
:
Optional
[
int
]
=
None
,
period_id
:
Optional
[
int
]
=
None
,
):
"""
Get LessonPeriod object either by given object_id or by time and current person.
"""
if
period_id
:
lesson_period
=
LessonPeriod
.
objects
.
get
(
pk
=
period_id
)
elif
hasattr
(
request
,
"
user
"
)
and
hasattr
(
request
.
user
,
"
person
"
):
@@ -37,6 +38,7 @@ def get_instance_by_pk(
type_
:
Optional
[
str
]
=
None
,
id_
:
Optional
[
int
]
=
None
,
):
"""
Get Instance object by given type and id or the current person.
"""
if
type_
and
id_
:
return
get_el_by_pk
(
request
,
type_
,
id_
)
elif
hasattr
(
request
,
"
user
"
)
and
hasattr
(
request
.
user
,
"
person
"
):
Loading