Use custom template to render meta tags properly

This commit is contained in:
Iacopo Spalletti 2015-10-18 12:46:50 +02:00
commit 2490447f44
6 changed files with 60 additions and 5 deletions

View file

@ -203,7 +203,21 @@ class Post(ModelMeta, TranslatableModel):
Retrieves django-meta attributes from apphook config instance
:param param: django-meta attribute passed as key
"""
return getattr(self.app_config, param)
attr = None
value = getattr(self.app_config, param)
if value:
attr = getattr(self, value, None)
if attr is not None:
if callable(attr):
try:
data = attr(param)
except TypeError:
data = attr()
else:
data = attr
else:
data = value
return data
def save_translation(self, translation, *args, **kwargs):
if not translation.slug and translation.title: