aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/resources.py
diff options
context:
space:
mode:
authorAlen Mujezinovic2012-03-20 13:21:24 +0000
committerAlen Mujezinovic2012-03-20 13:21:24 +0000
commite3d7c361051bde7b6d712ca975b4fe14f6449c15 (patch)
treee36bcf3b172d2886f222605edfd90d19cd18f40f /djangorestframework/resources.py
parent537fa19bacd97743555b3cac2a3e3c6e14786124 (diff)
downloaddjango-rest-framework-e3d7c361051bde7b6d712ca975b4fe14f6449c15.tar.bz2
Don't return unknown field errors if allow_unknown_form_fields is True
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