aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/resource.py
diff options
context:
space:
mode:
authorTom Christie2011-04-27 18:53:54 +0100
committerTom Christie2011-04-27 18:53:54 +0100
commit5921e5c84e13cafe90061629262f12dfe742c07a (patch)
tree2d56ef1264b47704a4f9042aa5c6cb1cea4d465d /djangorestframework/resource.py
parent5a59f339c1757767b136de33faa5b67a972141a1 (diff)
downloaddjango-rest-framework-5921e5c84e13cafe90061629262f12dfe742c07a.tar.bz2
Fix up ModelResource issues
Diffstat (limited to 'djangorestframework/resource.py')
-rw-r--r--djangorestframework/resource.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/djangorestframework/resource.py b/djangorestframework/resource.py
index fdbce8b5..636fe0ba 100644
--- a/djangorestframework/resource.py
+++ b/djangorestframework/resource.py
@@ -54,7 +54,7 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
@property
def allowed_methods(self):
- return [method.upper() for method in self.http_method_names if getattr(self, method, None)]
+ return [method.upper() for method in self.http_method_names if hasattr(self, method)]
def http_method_not_allowed(self, request, *args, **kwargs):
"""Return an HTTP 405 error if an operation is called which does not have a handler method."""
@@ -97,9 +97,6 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View):
# 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)
- # If a previously defined method has been disabled
- if handler is None:
- handler = self.http_method_not_allowed
else:
handler = self.http_method_not_allowed