Removed django.views.defaults.shortcut and django.conf.urls.shortcut per deprecation timeline.

This commit is contained in:
Tim Graham 2014-03-21 07:56:00 -04:00
parent bcc15e2b21
commit 9344bbb446
2 changed files with 0 additions and 23 deletions

View File

@ -1,11 +0,0 @@
import warnings
from django.conf.urls import patterns
from django.utils.deprecation import RemovedInDjango18Warning
warnings.warn("django.conf.urls.shortcut will be removed in Django 1.8.",
RemovedInDjango18Warning)
urlpatterns = patterns('django.views',
(r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
)

View File

@ -1,9 +1,6 @@
import warnings
from django import http from django import http
from django.template import (Context, RequestContext, from django.template import (Context, RequestContext,
loader, Template, TemplateDoesNotExist) loader, Template, TemplateDoesNotExist)
from django.utils.deprecation import RemovedInDjango18Warning
from django.views.decorators.csrf import requires_csrf_token from django.views.decorators.csrf import requires_csrf_token
@ -81,12 +78,3 @@ def permission_denied(request, template_name='403.html'):
except TemplateDoesNotExist: except TemplateDoesNotExist:
return http.HttpResponseForbidden('<h1>403 Forbidden</h1>', content_type='text/html') return http.HttpResponseForbidden('<h1>403 Forbidden</h1>', content_type='text/html')
return http.HttpResponseForbidden(template.render(RequestContext(request))) return http.HttpResponseForbidden(template.render(RequestContext(request)))
def shortcut(request, content_type_id, object_id):
warnings.warn(
"django.views.defaults.shortcut will be removed in Django 1.8. "
"Import it from django.contrib.contenttypes.views instead.",
RemovedInDjango18Warning, stacklevel=2)
from django.contrib.contenttypes.views import shortcut as real_shortcut
return real_shortcut(request, content_type_id, object_id)