X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c2e8051452fa55db096553cbe5ae622fc363d481..2034e81d72872e673c2ee733b09542c717a7a266:/src/picture/models.py?ds=sidebyside diff --git a/src/picture/models.py b/src/picture/models.py index 1ad09e2d8..3a05ad8dc 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -110,6 +110,9 @@ class Picture(models.Model): verbose_name = _('picture') verbose_name_plural = _('pictures') + def get_extra_info_json(self): + return json.loads(self.extra_info or '{}') + def save(self, force_insert=False, force_update=False, **kwargs): from sortify import sortify @@ -118,7 +121,7 @@ class Picture(models.Model): try: author = self.authors().first().sort_key except AttributeError: - author = u'' + author = '' self.sort_key_author = author ret = super(Picture, self).save(force_insert, force_update)