mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 04:58:42 +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,9 +9,8 @@ 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:
|
|
||||||
# NOTE - is transaction doing anything here??
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
|
try:
|
||||||
yield
|
yield
|
||||||
except IntegrityError as e:
|
except IntegrityError as e:
|
||||||
if e.__cause__.pgcode == errorcodes.UNIQUE_VIOLATION:
|
if e.__cause__.pgcode == errorcodes.UNIQUE_VIOLATION:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue