Skip to content

Commit

Permalink
[Core] Move the settings.
Browse files Browse the repository at this point in the history
Remove the configuration field and read directly the settings.
  • Loading branch information
hobbestigrou committed Apr 3, 2018
1 parent da61d38 commit 6c90975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions django_cprofile_middleware/conf.py

This file was deleted.

4 changes: 2 additions & 2 deletions django_cprofile_middleware/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
from django.conf import settings
from django.http import HttpResponse

from django_cprofile_middleware.conf import CPROFILE_MIDDLEWARE_REQUIRE_STAFF

if django.VERSION >= (1, 10):
from django.utils.deprecation import MiddlewareMixin
else:
Expand Down Expand Up @@ -47,6 +45,8 @@ def can(self, request):
return False

prof = request.GET.get('prof', None)
CPROFILE_MIDDLEWARE_REQUIRE_STAFF = getattr(
settings, 'CPROFILE_MIDDLEWARE_REQUIRE_STAFF', True)

return settings.DEBUG and prof \
and request.user.is_staff or not CPROFILE_MIDDLEWARE_REQUIRE_STAFF
Expand Down

0 comments on commit 6c90975

Please sign in to comment.