Merge pull request #2459 from alphagov/update-response-for-duplicate-domains

The previous PR added a error handler for the wrong db exception.
This commit is contained in:
Rebecca Law
2019-04-15 12:10:44 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -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