Ticket #15755: admin.diff
File admin.diff, 1.5 KB (added by , 14 years ago) |
---|
-
conf/global_settings.py
484 484 # The number of days a password reset link is valid for 485 485 PASSWORD_RESET_TIMEOUT_DAYS = 3 486 486 487 # Whether the admin app should handle user authentication. 488 ADMIN_HANDLE_LOGINS = True 489 487 490 ######## 488 491 # CSRF # 489 492 ######## -
contrib/admin/sites.py
7 7 from django.contrib.contenttypes import views as contenttype_views 8 8 from django.views.decorators.csrf import csrf_protect 9 9 from django.db.models.base import ModelBase 10 from django.core.exceptions import ImproperlyConfigured 10 from django.core.exceptions import ImproperlyConfigured, PermissionDenied 11 11 from django.core.urlresolvers import reverse 12 12 from django.shortcuts import render_to_response 13 13 from django.utils.safestring import mark_safe … … 193 193 """ 194 194 def inner(request, *args, **kwargs): 195 195 if not self.has_permission(request): 196 return self.login(request) 196 if settings.ADMIN_HANDLE_LOGINS: 197 return self.login(request) 198 else: 199 raise PermissionDenied 197 200 return view(request, *args, **kwargs) 198 201 if not cacheable: 199 202 inner = never_cache(inner)