Guard against attempted deletion of inexistent attributes

Fixes #76
This commit is contained in:
Cristi Vîjdea committed 2018-03-05 19:59:03 +02:00
1 parent 3d3b7899e5
commit 9ad55bac99
3 files changed
+13 -4

No files matched your search

+2 -2
View File
@@ -89,9 +89,9 @@ class InlineSerializerInspector(SerializerInspector):
properties=properties,
required=required or None,
)
if not ref_name:
if not ref_name and 'title' in result:
# on an inline model, the title is derived from the field name
# but is visually displayed like the model named, which is confusing
# but is visually displayed like the model name, which is confusing
# it is better to just remove title from inline models
del result.title
return result