From b9dec98647e129dd14a77afbc3fe83991ce7e851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Padilla?= Date: Fri, 26 Jun 2015 11:51:24 -0400 Subject: [PATCH] Correctly report allowed methods --- rest_framework/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index a709c2f6b..102a8479e 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -129,7 +129,12 @@ class APIView(View): """ Wrap Django's private `_allowed_methods` interface in a public property. """ - return self._allowed_methods() + allowed_methods = self._allowed_methods() + + if not api_settings.SUPPORT_PATCH and 'PATCH' in allowed_methods: + allowed_methods.remove('PATCH') + + return allowed_methods @property def default_response_headers(self):