mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-01 05:54:01 +03:00
Update djangorestframework/views.py
Avoid the extra call to .lower
This commit is contained in:
parent
db7d15d5d1
commit
81a306d5fc
|
@ -220,8 +220,9 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
|
||||||
self._check_permissions()
|
self._check_permissions()
|
||||||
|
|
||||||
# Get the appropriate handler method
|
# Get the appropriate handler method
|
||||||
if self.method.lower() in self.http_method_names:
|
method_name = self.method.lower()
|
||||||
handler = getattr(self, self.method.lower(), self.http_method_not_allowed)
|
if method_name in self.http_method_names:
|
||||||
|
handler = getattr(self, method_name, self.http_method_not_allowed)
|
||||||
else:
|
else:
|
||||||
handler = self.http_method_not_allowed
|
handler = self.http_method_not_allowed
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user