Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
42a6b876
Verified
Commit
42a6b876
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite dt_show_toolbar to account for request objects without a user
parent
ce304143
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#296
passed
5 years ago
Stage: test
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biscuit/core/util/core_helpers.py
+9
-1
9 additions, 1 deletion
biscuit/core/util/core_helpers.py
with
9 additions
and
1 deletion
biscuit/core/util/core_helpers.py
+
9
−
1
View file @
42a6b876
...
...
@@ -8,8 +8,16 @@ from django.http import HttpRequest
def
dt_show_toolbar
(
request
:
HttpRequest
)
->
bool
:
from
debug_toolbar.middleware
import
show_toolbar
# noqa
return
settings
.
DEBUG
and
(
show_toolbar
(
request
)
or
request
.
user
.
is_superuser
)
if
not
settings
.
DEBUG
:
return
False
if
show_toolbar
(
request
):
return
True
elif
hasattr
(
request
,
'
user
'
)
and
request
.
user
.
is_superuser
:
return
True
return
False
def
get_app_packages
()
->
Sequence
[
str
]:
"""
Find all packages within the biscuit.apps namespace.
"""
...
...
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