Handle empty title in metas headers adapter
authorThierry Florac <tflorac@ulthar.net>
Wed, 13 Feb 2019 17:03:31 +0100
changeset 520 f810009afcc6
parent 519 cef411a4be15
child 521 0e81b0d67daf
Handle empty title in metas headers adapter
src/pyams_skin/metas.py
--- a/src/pyams_skin/metas.py	Fri Feb 01 18:36:26 2019 +0100
+++ b/src/pyams_skin/metas.py	Wed Feb 13 17:03:31 2019 +0100
@@ -146,7 +146,7 @@
 
     def get_metas(self):
         title = II18n(self.context).query_attribute('title', request=self.request)
-        yield HTMLTagMeta('title', title)
+        yield HTMLTagMeta('title', title or '----')
 
 
 @adapter_config(name='title', context=(ISiteRoot, Interface, Interface), provides=IHTMLContentMetas)
@@ -157,7 +157,7 @@
 
     def get_metas(self):
         config = IConfiguration(self.context)
-        yield HTMLTagMeta('title', config.title)
+        yield HTMLTagMeta('title', config.title or '----')
         yield ContentMeta('description', config.description)