revert db_helpers change

This commit is contained in:
zandercymatics 2025-02-04 13:52:40 -07:00
parent b8504592c5
commit 7c613a01f8
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -9,13 +9,12 @@ def ignore_unique_violation():
Execute within an atomic transaction so that if a unique constraint violation occurs,
the individual transaction is rolled back without invalidating any larger transaction.
"""
try:
# NOTE - is transaction doing anything here??
with transaction.atomic():
with transaction.atomic():
try:
yield
except IntegrityError as e:
if e.__cause__.pgcode == errorcodes.UNIQUE_VIOLATION:
# roll back to the savepoint, effectively ignoring this transaction
pass
else:
raise e
except IntegrityError as e:
if e.__cause__.pgcode == errorcodes.UNIQUE_VIOLATION:
# roll back to the savepoint, effectively ignoring this transaction
pass
else:
raise e