Skip to content

Saleor Core: the high performance, composable, headless commerce API.

remove integrity error as it is a subclass of DatabaseError

Maciej Korycinskid25f194b2a8e
diff --git a/saleor/core/transactions.py b/saleor/core/transactions.py
index 7f961b2891..876cbb051c 100644
--- a/saleor/core/transactions.py
+++ b/saleor/core/transactions.py
@@ -1,6 +1,6 @@
from contextlib import contextmanager
-from django.db import DatabaseError, IntegrityError, transaction
+from django.db import DatabaseError, transaction
@contextmanager
@@ -10,7 +10,7 @@ def transaction_with_commit_on_errors():
with transaction.atomic():
try:
yield
- except (DatabaseError, IntegrityError):
+ except DatabaseError:
raise
except Exception as e:
error = e