Skip to content

Commit

Permalink
Merge pull request #28 from openimis/feature/OP-762
Browse files Browse the repository at this point in the history
OP-762: revert change for 'relevance' and schema
  • Loading branch information
delcroip authored Apr 28, 2022
2 parents 86d87a3 + 5de77ec commit c2b9ff9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions calculation/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ def resolve_calculation_params(parent, info, **kwargs):
value=ov["value"],
label=LabelParamGQLType(en=ov["label"]["en"], fr=ov["label"]["fr"])
) for ov in param["optionSet"]] if "optionSet" in param else []

if "condition" in param:
condition = param["condition"] if param["condition"] else None
else:
condition = None
if "relevance" in param:
relevance = param["relevance"] if param["relevance"] else None
else:
relevance = None

list_params.append(
CalculationParamsGQLType(
Expand All @@ -193,9 +202,9 @@ def resolve_calculation_params(parent, info, **kwargs):
label=label,
rights=rights,
option_set=option_set,
relevance=param["relevance"] if "relevance" in param and param["relevance"] is not None else True,
condition= param["condition"] if "condition" in param and param["condition"] is not None else True,
default_value=param['default'] if 'default' in param and param['default'] is not None else "null" ,
relevance=relevance,
condition=condition,
default_value=param['default'] if 'default' in param else "null",
)
)
return CalculationParamsListGQLType(list_params)
Expand Down

0 comments on commit c2b9ff9

Please sign in to comment.