diff --git a/drf_dynamic_fields/__init__.py b/drf_dynamic_fields/__init__.py index 73ae6cf..4c51fa4 100644 --- a/drf_dynamic_fields/__init__.py +++ b/drf_dynamic_fields/__init__.py @@ -43,6 +43,10 @@ def fields(self): warnings.warn('Context does not have access to request. ' 'See README for more information.') return fields + + # Dynamic fields must be used for GET method only + if request.method != 'GET': + return fields # NOTE: drf test framework builds a request object where the query # parameters are found under the GET attribute.