Fixed exceptions in __str__

This commit is contained in:
Iacopo Spalletti 2017-06-06 07:05:50 +02:00
parent 10c8f0f2dd
commit 1809354573
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6
2 changed files with 3 additions and 2 deletions

View file

@ -9,6 +9,7 @@ History
*******************
* Drop python 2.6 compatibility
* Fixed exceptions in __str__
*******************
0.8.12 (2017-03-11)

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):