X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/a31dc3ca0f28d89b0b18b9d4c857f64ac9488b7a..ee7f2fa4a7e08ca2f8c88f2a521ef65cbca3aac4:/apps/catalogue/management/commands/importbooks.py 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)