diff --git a/controllers/base.py b/controllers/base.py index 74f5638..08d8e58 100644 --- a/controllers/base.py +++ b/controllers/base.py @@ -573,7 +573,7 @@ def post_method_api_resource_create(self): except Error as error: if error.pgcode == "23505": # 23505 - unique_violation error = str(error).replace("\n", " ").split("DETAIL: ")[1] - raise HTTPError(400, "Attribute already exists. (error: " + str(error) + ")") + raise HTTPError(409, "Attribute already exists. (error: " + str(error) + ")") elif error.pgcode == "22023": # 22023 - invalid_parameter_value raise HTTPError(400, "One specified attribute is invalid. (error: " + str(error) + ")") else: