mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
fields should respect error messages on the parent field
This commit is contained in:
parent
4f252086df
commit
2a0ac4c80f
|
@ -900,6 +900,9 @@ class ModelSerializer(Serializer):
|
|||
if model_field.help_text is not None:
|
||||
kwargs['help_text'] = model_field.help_text
|
||||
|
||||
if model_field.error_messages is not None:
|
||||
kwargs['error_messages'] = model.error_messages
|
||||
|
||||
# TODO: TypedChoiceField?
|
||||
if model_field.flatchoices: # This ModelField contains choices
|
||||
kwargs['choices'] = model_field.flatchoices
|
||||
|
|
Loading…
Reference in New Issue
Block a user