mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Advanced deprecations in core.mail, core.commands, core.context_processors and core.handlers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -11,24 +11,6 @@ from django.conf import settings
|
||||
from django.middleware.csrf import get_token
|
||||
from django.utils.functional import lazy
|
||||
|
||||
def auth(request):
|
||||
"""
|
||||
DEPRECATED. This context processor is the old location, and has been moved
|
||||
to `django.contrib.auth.context_processors`.
|
||||
|
||||
This function still exists for backwards-compatibility; it will be removed
|
||||
in Django 1.4.
|
||||
"""
|
||||
import warnings
|
||||
warnings.warn(
|
||||
"The context processor at `django.core.context_processors.auth` is " \
|
||||
"deprecated; use the path `django.contrib.auth.context_processors.auth` " \
|
||||
"instead.",
|
||||
DeprecationWarning
|
||||
)
|
||||
from django.contrib.auth.context_processors import auth as auth_context_processor
|
||||
return auth_context_processor(request)
|
||||
|
||||
def csrf(request):
|
||||
"""
|
||||
Context processor that provides a CSRF token, or the string 'NOTPROVIDED' if
|
||||
@@ -97,7 +79,7 @@ class PermLookupDict(RealPermLookupDict):
|
||||
"`django.core.context_processors.PermLookupDict` is " \
|
||||
"deprecated; use `django.contrib.auth.context_processors.PermLookupDict` " \
|
||||
"instead.",
|
||||
PendingDeprecationWarning
|
||||
DeprecationWarning
|
||||
)
|
||||
super(PermLookupDict, self).__init__(*args, **kwargs)
|
||||
|
||||
@@ -108,6 +90,6 @@ class PermWrapper(RealPermWrapper):
|
||||
"`django.core.context_processors.PermWrapper` is " \
|
||||
"deprecated; use `django.contrib.auth.context_processors.PermWrapper` " \
|
||||
"instead.",
|
||||
PendingDeprecationWarning
|
||||
DeprecationWarning
|
||||
)
|
||||
super(PermWrapper, self).__init__(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user