X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d55ea605b29c6a30f3e10c20325335a9d4ae672b..886286a97f29204af33d0061ae51eb1b19ec0441:/apps/catalogue/management/commands/mark_final.py diff --git a/apps/catalogue/management/commands/mark_final.py b/apps/catalogue/management/commands/mark_final.py index 91281bbb..cdfaab93 100644 --- a/apps/catalogue/management/commands/mark_final.py +++ b/apps/catalogue/management/commands/mark_final.py @@ -7,7 +7,6 @@ import sys from django.contrib.auth.models import User from optparse import make_option -from collections import defaultdict from django.core.management import BaseCommand from catalogue.models import Book, Chunk @@ -39,14 +38,13 @@ class Command(BaseCommand): for book in books: print 'processing %s' % book.slug - chunk = book.chunk_set.first() - src = chunk.head.materialize() - new_head = chunk.commit( - text=src, - author=user, - description=u'Ostateczna akceptacja merytoryczna przez kierownika literackiego.', - tags=[Chunk.tag_model.objects.get(slug='editor-proofreading')], - publishable=True - ) + for chunk in book.chunk_set.all(): + src = chunk.head.materialize() + chunk.commit( + text=src, + author=user, + description=u'Ostateczna akceptacja merytoryczna przez kierownika literackiego.', + tags=[Chunk.tag_model.objects.get(slug='editor-proofreading')], + publishable=True + ) print 'committed %s' % book.slug - new_head.set_publishable(True)