From 9e020f2a463e49b2aa799d3d3305f82dd01bece1 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Tue, 31 Jan 2012 13:20:39 +0100 Subject: [PATCH] commit tx --- apps/catalogue/management/commands/importbooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.20.1