Ticket #17288: patch.diff
File patch.diff, 1.2 KB (added by , 13 years ago) |
---|
-
django/views/generic/base.py
53 53 update_wrapper(view, cls.dispatch, assigned=()) 54 54 return view 55 55 56 # @returns The function name to be called when the HTTP method 'http_method_name'is 57 # requested. 58 # @param http_method_name The HTTP method name, i.e. 'get', 'post' and so forth. 59 def get_method_name_for_http_method(self, http_method_name): 60 return http_method_name.lower() 61 56 62 def dispatch(self, request, *args, **kwargs): 57 63 # Try to dispatch to the right method; if a method doesn't exist, 58 64 # defer to the error handler. Also defer to the error handler if the 59 65 # request method isn't on the approved list. 60 66 if request.method.lower() in self.http_method_names: 61 handler = getattr(self, request.method.lower(), self.http_method_not_allowed)67 handler = getattr(self, self.get_method_name_for_http_method(request.method), self.http_method_not_allowed) 62 68 else: 63 69 handler = self.http_method_not_allowed 64 70 self.request = request