Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a failing test in special_headers, and performed a bit of cleanup.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2f9c52dc900f9cf689af23fbe5b4947ef97a924f 1 parent 930371e
@alex alex authored
View
5 django/views/generic/base.py
@@ -44,8 +44,6 @@ def as_view(cls, **initkwargs):
def view(request, *args, **kwargs):
self = cls(**initkwargs)
- if hasattr(self, 'get') and not hasattr(self, 'head'):
- self.head = self.get
return self.dispatch(request, *args, **kwargs)
# take name and docstring from class
@@ -79,6 +77,9 @@ def http_method_not_allowed(self, request, *args, **kwargs):
)
return http.HttpResponseNotAllowed(allowed_methods)
+ def head(self, *args, **kwargs):
+ return self.get(*args, **kwargs)
+
class TemplateResponseMixin(object):
"""
View
2  tests/regressiontests/special_headers/views.py
@@ -10,5 +10,5 @@ def xview(request):
return HttpResponse()
class XViewClass(View):
- def get(request):
+ def get(self, request):
return HttpResponse()
Please sign in to comment.
Something went wrong with that request. Please try again.