mirror of
https://github.com/django/django.git
synced 2024-12-24 18:16:19 +00:00
Removed django.views.defaults.shortcut and django.conf.urls.shortcut per deprecation timeline.
This commit is contained in:
parent
bcc15e2b21
commit
9344bbb446
@ -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'),
|
||||
)
|
@ -1,9 +1,6 @@
|
||||
import warnings
|
||||
|
||||
from django import http
|
||||
from django.template import (Context, RequestContext,
|
||||
loader, Template, TemplateDoesNotExist)
|
||||
from django.utils.deprecation import RemovedInDjango18Warning
|
||||
from django.views.decorators.csrf import requires_csrf_token
|
||||
|
||||
|
||||
@ -81,12 +78,3 @@ def permission_denied(request, template_name='403.html'):
|
||||
except TemplateDoesNotExist:
|
||||
return http.HttpResponseForbidden('<h1>403 Forbidden</h1>', content_type='text/html')
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user