mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
revert db_helpers change
This commit is contained in:
parent
b8504592c5
commit
7c613a01f8
1 changed files with 8 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue