From 12f2544ad51f1e840ae084305528887bf9153315 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 26 Mar 2016 01:19:25 +0100 Subject: [PATCH] Minor code reorg --- djangocms_blog/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index f85848a..2ce9a43 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -188,6 +188,11 @@ class Post(ModelMeta, TranslatableModel): def __str__(self): return self.safe_translation_getter('title') + def save_translation(self, translation, *args, **kwargs): + if not translation.slug and translation.title: + translation.slug = slugify(translation.title) + super(Post, self).save_translation(translation, *args, **kwargs) + def get_absolute_url(self, lang=None): if not lang: lang = get_language() @@ -227,11 +232,6 @@ class Post(ModelMeta, TranslatableModel): data = value return data - def save_translation(self, translation, *args, **kwargs): - if not translation.slug and translation.title: - translation.slug = slugify(translation.title) - super(Post, self).save_translation(translation, *args, **kwargs) - def get_title(self): title = self.safe_translation_getter('meta_title', any_language=True) if not title: