Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
switch to allow all admin users to see profiler tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
darktable committed Jun 27, 2011
1 parent f1397ed commit 4c3e331
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
6 changes: 6 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
"test1@example.com",
]

enable_profiler_admins = True

# Customize should_profile to return true whenever a request should be profiled.
# This function will be run once per request, so make sure its contents are fast.
def should_profile(environ):
user = users.get_current_user()

if enable_profiler_admins and users.is_current_user_admin():
return True

return user and user.email() in enabled_profiler_emails
2 changes: 1 addition & 1 deletion templates/includes.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<link rel="stylesheet" type="text/css" href="{{ css_path|escape }}" />
<script type="text/javascript" src="{{ js_path|escape }}"></script>
<script type="text/javascript">GaeMiniProfiler.init({{ request_id_js|safe }}, {{ show_immediately_js }})</script>
<script type="text/javascript">GaeMiniProfiler.init("{{ request_id }}", {{ show_immediately_js }})</script>

0 comments on commit 4c3e331

Please sign in to comment.