Skip to content
Snippets Groups Projects
Commit 912e6a60 authored by Brittany Faciane's avatar Brittany Faciane
Browse files

Adding an exception for wrong number of project code values.

parent 726dc7a7
No related branches found
No related tags found
3 merge requests!1606catch 2.8.3 up with main,!1605Merge 2.8.2.3 work to main,!1589Fix the core sampler access to project code linking table.
Pipeline #14494 passed
......@@ -359,6 +359,9 @@ class ProductsProjectsFinder:
cursor.execute(sql, {"spls": tuple(spls)})
data = cursor.fetchall()
if len(data) != 1:
raise Exception("Either too many project codes or no project codes were found for product group.")
# All spls will have the same project code, but return a list with a length matching the spls list
return [data[0]["project_code"]] * len(spls)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment