Minor code reorg
This commit is contained in:
parent
36af7833af
commit
12f2544ad5
1 changed files with 5 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue