Guard against attempted deletion of inexistent attributes

Fixes #76
This commit is contained in:
Cristi Vîjdea
2018-03-05 19:59:03 +02:00
parent 3d3b7899e5
commit 9ad55bac99
3 changed files with 13 additions and 4 deletions
+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