mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Fixed a bug with type and python 2.x compat.
This commit is contained in:
parent
73572bc199
commit
d6b4a6b04a
|
@ -382,7 +382,7 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
|
||||
# Creating an on the fly form see:
|
||||
# http://stackoverflow.com/questions/3915024/dynamically-creating-classes-python
|
||||
OnTheFlyForm = type("OnTheFlyForm", (forms.Form,), fields)
|
||||
OnTheFlyForm = type(str("OnTheFlyForm"), (forms.Form,), fields)
|
||||
data = (obj is not None) and serializer.data or None
|
||||
form_instance = OnTheFlyForm(data)
|
||||
return form_instance
|
||||
|
|
Loading…
Reference in New Issue
Block a user