diff --git a/backend/project/utils/query_agent.py b/backend/project/utils/query_agent.py index 2398d9be..d530f8a6 100644 --- a/backend/project/utils/query_agent.py +++ b/backend/project/utils/query_agent.py @@ -94,9 +94,8 @@ def insert_into_model(model: DeclarativeMeta, a message indicating that something went wrong while inserting into the database. """ try: - new_instance = create_model_instance(model, data, response_url_base, required_fields) - model_instance = new_instance[0] - status_code = new_instance[1] + model_instance, status_code = create_model_instance(model, data, response_url_base, required_fields) + # if its a tuple the model instance couldn't be created so it already # is the right format of error message and we just need to return if status_code == 400: