From 81a306d5fc7c0f736f9952c10a364754e278a974 Mon Sep 17 00:00:00 2001 From: David Guaraglia Date: Fri, 24 Aug 2012 14:16:54 -0700 Subject: [PATCH] Update djangorestframework/views.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid the extra call to .lower  --- djangorestframework/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/djangorestframework/views.py b/djangorestframework/views.py index 4aa6ca0cd..611723c55 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -220,8 +220,9 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): self._check_permissions() # Get the appropriate handler method - if self.method.lower() in self.http_method_names: - handler = getattr(self, self.method.lower(), self.http_method_not_allowed) + method_name = self.method.lower() + if method_name in self.http_method_names: + handler = getattr(self, method_name, self.http_method_not_allowed) else: handler = self.http_method_not_allowed