From: Marcin Koziej Date: Tue, 31 Jan 2012 12:20:39 +0000 (+0100) Subject: commit tx X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/9e020f2a463e49b2aa799d3d3305f82dd01bece1?ds=sidebyside;hp=-c commit tx --- 9e020f2a463e49b2aa799d3d3305f82dd01bece1 diff --git a/apps/catalogue/management/commands/importbooks.py b/apps/catalogue/management/commands/importbooks.py index 7fe602254..ff9184e47 100644 --- a/apps/catalogue/management/commands/importbooks.py +++ b/apps/catalogue/management/commands/importbooks.py @@ -127,7 +127,8 @@ class Command(BaseCommand): else: self.import_book(file_path, options) files_imported += 1 - + transaction.commit() + except (Book.AlreadyExists, Picture.AlreadyExists): print self.style.ERROR('%s: Book or Picture already imported. Skipping. To overwrite use --force.' % file_path)