-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
+# 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 migrations, models
book.cached_author = ', '.join(
TagRelation.objects.filter(content_type__model='book', object_id=book.id, tag__category='author')
.values_list('tag__name', flat=True))
- book.has_audience = 'audience' in book.extra_info
+ book.has_audience = 'audience' in book.get_extra_info_json()
book.save()
name='has_audience',
field=models.BooleanField(default=False),
),
- migrations.RunPython(refresh_books, lambda apps, schema_editor: None),
+ migrations.RunPython(refresh_books, migrations.RunPython.noop),
]