diff --git a/app/management/commands/import.py b/app/management/commands/import.py index 917ff10..77cf7c5 100644 --- a/app/management/commands/import.py +++ b/app/management/commands/import.py @@ -1,3 +1,4 @@ +import django.db.utils from django.core.management.base import BaseCommand, CommandError from django.apps import apps @@ -401,7 +402,14 @@ class Command(BaseCommand): try: m = _model(**_object_dict) m.save() + except django.db.utils.IntegrityError as ex1: + error_row_count += 1 + print(str(ex1)) + print("**********************") + print(str(_object_dict)) + print("**********************") except Exception as ex: + error_row_count += 1 print('-----') print(str(ex)) print('----------------')