Merge pull request #371 from nephila/issue-369

Fixed exceptions in __str__
This commit is contained in:
Iacopo Spalletti 2017-06-07 15:24:20 +02:00 committed by GitHub
commit 384442f340
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,8 @@ History
0.8.13 (unreleased)
*******************
* Drop python 2.6 compatibility
* Fixed exceptions in __str__
* Drop python 2.6 compatibility
*******************

View file

@ -98,7 +98,7 @@ class BlogCategory(TranslatableModel):
)
def __str__(self):
return self.safe_translation_getter('name')
return self.safe_translation_getter('name', any_language=True)
def save(self, *args, **kwargs):
super(BlogCategory, self).save(*args, **kwargs)
@ -203,7 +203,7 @@ class Post(KnockerModel, ModelMeta, TranslatableModel):
get_latest_by = 'date_published'
def __str__(self):
return self.safe_translation_getter('title')
return self.safe_translation_getter('title', any_language=True)
@property
def guid(self, language=None):