diff options
| author | Ian Strachan | 2012-10-22 22:24:26 +0100 |
|---|---|---|
| committer | Ian Strachan | 2012-10-22 22:24:26 +0100 |
| commit | c7a0d52fd7e22fbc4a01ff900bd3b2c1215e984d (patch) | |
| tree | 164bc17f49ff80155edf846e94855369b8228878 /rest_framework/fields.py | |
| parent | aba0172f5c988af145113678fe3d4f411111d4ff (diff) | |
| download | django-rest-framework-c7a0d52fd7e22fbc4a01ff900bd3b2c1215e984d.tar.bz2 | |
#314 Fix for manytomany field being required in the payload even though the field is specified as readonly in the serializer
Diffstat (limited to 'rest_framework/fields.py')
| -rw-r--r-- | rest_framework/fields.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index f610d6aa..6ed37823 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -256,6 +256,9 @@ class ManyRelatedMixin(object): return [self.to_native(item) for item in value.all()] def field_from_native(self, data, field_name, into): + if self.readonly: + return + try: # Form data value = data.getlist(self.source or field_name) |
