X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..150c16b9cecccacdbf17360d334fc618172f4179:/src/catalogue/models/source.py?ds=sidebyside diff --git a/src/catalogue/models/source.py b/src/catalogue/models/source.py index f36850ddd..ee024e0e6 100644 --- a/src/catalogue/models/source.py +++ b/src/catalogue/models/source.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Source(models.Model): @@ -26,7 +25,7 @@ class Source(models.Model): str(self.pk) old_self = type(self).objects.get(pk=self) except type(self).DoesNotExist: - old_name = u'' + old_name = '' old_netloc = self.netloc else: old_name = old_self.name @@ -38,7 +37,7 @@ class Source(models.Model): # and invalidate their cached includes. if old_name != self.name or old_netloc != self.netloc: for book in Book.objects.all(): - source = book.extra_info.get('source_url', '') + source = book.get_extra_info_json().get('source_url', '') if self.netloc in source or (old_netloc != self.netloc and old_netloc in source): - book.flush_includes() + book.clear_cache() return ret