mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
Turns out label and help_text are not always there
This commit is contained in:
parent
1343398868
commit
e7ddaf5472
|
@ -366,8 +366,11 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
if getattr(v, 'default', None) is not None:
|
||||
kwargs['initial'] = v.default
|
||||
|
||||
kwargs['label'] = v.label
|
||||
kwargs['help_text'] = v.help_text
|
||||
if getattr(v, 'label', None) is not None:
|
||||
kwargs['label'] = v.label
|
||||
|
||||
if getattr(v, 'help_text', None) is not None:
|
||||
kwargs['help_text'] = v.help_text
|
||||
|
||||
fields[k] = v.form_field_class(**kwargs)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user