Skip to content

Commit

Permalink
tryfix-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
c4ffein committed Aug 4, 2024
1 parent 21363a1 commit d167ca7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions helpers/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def clean_integrity_error(error):
"""Helper to convert an IntegrityError from psycopg2/sqlite3 to a field name string"""
try:
if isinstance(error.__cause__, UniqueViolation):
raise Exception("YOU ARE TESTING POSTGRES")
return error.__cause__.args[0].split(":")[1].split("(")[1].split(")")[0]
if isinstance(error.__cause__, IntegrityError):
return error.__cause__.args[0].split(": ")[1].split(".")[1]
Expand Down

0 comments on commit d167ca7

Please sign in to comment.