mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 21:10:13 +03:00
Fix no write only fields in Browsable API forms
This commit is contained in:
parent
9d6129a95f
commit
500f996c31
|
@ -349,6 +349,9 @@ class BaseSerializer(WritableField):
|
||||||
try:
|
try:
|
||||||
value = field.field_to_native(obj, field_name)
|
value = field.field_to_native(obj, field_name)
|
||||||
except IgnoreFieldException:
|
except IgnoreFieldException:
|
||||||
|
if field.write_only:
|
||||||
|
ret.fields[key] = self.augment_field(field, field_name,
|
||||||
|
key, '')
|
||||||
continue
|
continue
|
||||||
method = getattr(self, 'transform_%s' % field_name, None)
|
method = getattr(self, 'transform_%s' % field_name, None)
|
||||||
if callable(method):
|
if callable(method):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user