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: