Skip to content
Snippets Groups Projects
Commit 2d4963e493e9 authored by Brendan Masson's avatar Brendan Masson
Browse files

Handle error mode in dimension sync action where no model matches the dimension

parent 2293351e1896
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@
DIMENSION_DUPLICATE_ERROR = _("Both {model1} and {model2} reference {dim}")
NO_MODEL_FOR_DIMENSION_ERROR = _("No model matches dimension {dim}")
def check_dimension_duplicate(models_by_dimension, dim_name, model_name):
......@@ -128,6 +129,11 @@
for record in self:
dimension_name = record.name
if dimension_name not in models_by_dimension:
raise ValidationError(
_(NO_MODEL_FOR_DIMENSION_ERROR).format(dim=dimension_name)
)
model_name = models_by_dimension[dimension_name]
code_column = column_by_name[dimension_name]
......
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