-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand
def ancestor_has_cover(book):
while book.parent:
book = book.parent
- if book.extra_info.get('cover_url'):
+ if book.get_extra_info_json().get('cover_url'):
return True
return False
with transaction.atomic():
for book in Book.objects.all().order_by('slug').iterator():
- extra_info = book.extra_info
+ extra_info = book.get_extra_info_json()
if not extra_info.get('cover_url'):
if ancestor_has_cover(book):
with_ancestral_cover.append(book)
for book in no_license:
print()
print(full_url(book))
- print(book.extra_info.get('cover_by'))
- print(book.extra_info.get('cover_source'))
- print(book.extra_info.get('cover_url'))
+ extra_info = book.get_extra_info_json()
+ print(extra_info.get('cover_by'))
+ print(extra_info.get('cover_source'))
+ print(extra_info.get('cover_url'))
if not_redakcja:
print()
for book in not_redakcja:
print()
print(full_url(book))
- print(book.extra_info.get('cover_by'))
- print(book.extra_info.get('cover_source'))
- print(book.extra_info.get('cover_url'))
+ extra_info = book.get_extra_info_json()
+ print(extra_info.get('cover_by'))
+ print(extra_info.get('cover_source'))
+ print(extra_info.get('cover_url'))
if without_cover:
print()