mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
The previous PR added a error handler for the wrong db exception.
This corrects it to look for the unique constraint.
This commit is contained in:
@@ -34,7 +34,7 @@ def handle_integrity_error(exc):
|
||||
if 'ix_organisation_name' in str(exc):
|
||||
return jsonify(result="error",
|
||||
message="Organisation name already exists"), 400
|
||||
if 'domain_organisation_id_fkey' in str(exc):
|
||||
if 'duplicate key value violates unique constraint "domain_pkey"' in str(exc):
|
||||
return jsonify(result='error',
|
||||
message='Domain already exists'), 400
|
||||
|
||||
|
||||
Reference in New Issue
Block a user