aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/resources.py
diff options
context:
space:
mode:
authorTom Christie2012-08-24 16:06:23 +0100
committerTom Christie2012-08-24 16:06:23 +0100
commit7557777c668e6b8eaa85b07971b94115a33c9358 (patch)
tree6bd152248eb1e535b86fbc4396fe16fa644a0d2f /djangorestframework/resources.py
parent2d2e2f95b0268c3282edfca5c047bdc831133016 (diff)
parentdb7d15d5d136a9b4dcf759f9d588006244bd4e91 (diff)
downloaddjango-rest-framework-7557777c668e6b8eaa85b07971b94115a33c9358.tar.bz2
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
Diffstat (limited to 'djangorestframework/resources.py')
-rw-r--r--djangorestframework/resources.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/djangorestframework/resources.py b/djangorestframework/resources.py
index f170eb45..5e350268 100644
--- a/djangorestframework/resources.py
+++ b/djangorestframework/resources.py
@@ -169,8 +169,9 @@ class FormResource(Resource):
)
# Add any unknown field errors
- for key in unknown_fields:
- field_errors[key] = [u'This field does not exist.']
+ if not self.allow_unknown_form_fields:
+ for key in unknown_fields:
+ field_errors[key] = [u'This field does not exist.']
if field_errors:
detail[u'field_errors'] = field_errors