Handle empty title in metas header adapter
authorThierry Florac <tflorac@ulthar.net>
Wed, 13 Feb 2019 17:04:57 +0100
changeset 418 ef8383d7b9a2
parent 417 beb53f316430
child 419 38df143ffb61
Handle empty title in metas header adapter
src/pyams_default_theme/shared/site/__init__.py
--- a/src/pyams_default_theme/shared/site/__init__.py	Wed Feb 13 17:04:35 2019 +0100
+++ b/src/pyams_default_theme/shared/site/__init__.py	Wed Feb 13 17:04:57 2019 +0100
@@ -51,7 +51,7 @@
         negotiator = get_utility(INegotiator)
         lang = negotiator.server_language
         title = i18n.query_attribute('title', lang=lang, request=request)
-        yield HTMLTagMeta('title', title)
+        yield HTMLTagMeta('title', title or '----')
         description = i18n.query_attribute('description', lang=lang, request=request)
         if (not description) and hasattr(context, 'header'):
             description = i18n.query_attribute('header', lang=lang, request=request)