Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 Gaynor authored
5  django/views/generic/base.py
@@ -44,8 +44,6 @@ def as_view(cls, **initkwargs):
44 44
 
45 45
         def view(request, *args, **kwargs):
46 46
             self = cls(**initkwargs)
47  
-            if hasattr(self, 'get') and not hasattr(self, 'head'):
48  
-                self.head = self.get
49 47
             return self.dispatch(request, *args, **kwargs)
50 48
 
51 49
         # take name and docstring from class
@@ -79,6 +77,9 @@ def http_method_not_allowed(self, request, *args, **kwargs):
79 77
         )
80 78
         return http.HttpResponseNotAllowed(allowed_methods)
81 79
 
  80
+    def head(self, *args, **kwargs):
  81
+        return self.get(*args, **kwargs)
  82
+
82 83
 
83 84
 class TemplateResponseMixin(object):
84 85
     """
2  tests/regressiontests/special_headers/views.py
@@ -10,5 +10,5 @@ def xview(request):
10 10
     return HttpResponse()
11 11
 
12 12
 class XViewClass(View):
13  
-    def get(request):
  13
+    def get(self, request):
14 14
         return HttpResponse()

0 notes on commit 2f9c52d

Please sign in to comment.
Something went wrong with that request. Please try again.