mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
Do not render HTML output for hidden fields. Closes #2410.
This commit is contained in:
parent
e59b3d1718
commit
4cf03e30ff
|
@ -410,6 +410,9 @@ class HTMLFormRenderer(BaseRenderer):
|
||||||
})
|
})
|
||||||
|
|
||||||
def render_field(self, field, parent_style):
|
def render_field(self, field, parent_style):
|
||||||
|
if isinstance(field, serializers.HiddenField):
|
||||||
|
return ''
|
||||||
|
|
||||||
style = dict(self.default_style[field])
|
style = dict(self.default_style[field])
|
||||||
style.update(field.style)
|
style.update(field.style)
|
||||||
if 'template_pack' not in style:
|
if 'template_pack' not in style:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user