zoo_data: ne pas extraire le schéma pour les objets n'en ayant pas (fixes #21791)

This commit is contained in:
Benjamin Dauvergne 2018-02-12 11:49:48 +01:00 committed by Thomas NOEL
parent c7a26bebe9
commit e2184aadf4
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class JSONEditorMixin(object):
def get_form(self, request, obj=None, **kwargs):
widgets = kwargs.setdefault('widgets', {})
for field in self.json_fields:
if obj:
if obj and hasattr(obj, 'schema'):
schema = obj.schema.schema
else:
schema = {}