X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/7d4e3e9e5032ce55d3ede125a28907721f1ff8e8..920e98157ef2c7f21888d5ef095134d3a971f39d:/apps/catalogue/management/commands/insert_isbn.py diff --git a/apps/catalogue/management/commands/insert_isbn.py b/apps/catalogue/management/commands/insert_isbn.py index e9727daa..7548cb1f 100644 --- a/apps/catalogue/management/commands/insert_isbn.py +++ b/apps/catalogue/management/commands/insert_isbn.py @@ -69,6 +69,7 @@ class Command(BaseCommand): csvfile.close() for slug, isbn_list in isbn_lists.iteritems(): + print 'processing %s' % slug book = Book.objects.get(dc_slug=slug) chunk = book.chunk_set.first() old_head = chunk.head @@ -76,7 +77,8 @@ class Command(BaseCommand): tree = etree.fromstring(src) isbn_node = tree.find('.//' + DCNS("relation.hasFormat")) if isbn_node is not None: - raise Exception('%s already contains ISBN metadata!' % slug) + print '%s already contains ISBN metadata, skipping' % slug + continue desc = tree.find(".//" + RDFNS("Description")) for format, isbn in isbn_list: for template in ISBN_TEMPLATES: