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