X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4b30aa4337497a5b225527900d67868912d3715e..HEAD:/src/catalogue/migrations/0016_auto_20171031_1232.py diff --git a/src/catalogue/migrations/0016_auto_20171031_1232.py b/src/catalogue/migrations/0016_auto_20171031_1232.py index 1dbee6085..81ddeef57 100644 --- a/src/catalogue/migrations/0016_auto_20171031_1232.py +++ b/src/catalogue/migrations/0016_auto_20171031_1232.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# 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.db import migrations, models @@ -12,7 +12,7 @@ def refresh_books(apps, schema_editor): 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() @@ -33,5 +33,5 @@ class Migration(migrations.Migration): name='has_audience', field=models.BooleanField(default=False), ), - migrations.RunPython(refresh_books, lambda apps, schema_editor: None), + migrations.RunPython(refresh_books, migrations.RunPython.noop), ]