fix: doc.get_title should return empty string if title is not set

(cherry picked from commit b244c9148192362de43aa483b328709745f3be82)
This commit is contained in:
Suraj Shetty 2022-06-13 11:12:53 +05:30 committed by Mergify
parent a4f2912fdf
commit 53a079f101

View file

@ -438,7 +438,7 @@ class Document(BaseDocument):
def get_title(self):
"""Get the document title based on title_field or `title` or `name`"""
return self.get(self.meta.get_title_field())
return self.get(self.meta.get_title_field()) or ""
def set_title_field(self):
"""Set title field based on template"""