From 98bbe59843fde5399a05e41268f257c7bcd4c1f5 Mon Sep 17 00:00:00 2001 From: Patrick Delcroix Date: Sun, 8 May 2022 13:37:19 +0200 Subject: [PATCH] get_calculation_object add get_calculation_object function --- calculation/services.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/calculation/services.py b/calculation/services.py index 991bdb3..f0522e0 100644 --- a/calculation/services.py +++ b/calculation/services.py @@ -20,6 +20,10 @@ def get_rule_details(class_name): list_rule_details.extend(result_signal) return list_rule_details +def get_calculation_object(uuid): + for calculation_rule in CALCULATION_RULES: + if str(calculation_rule.uuid) == str(uuid): + return calculation_rule def run_calculation_rules(instance, context, user): for calculation_rule in CALCULATION_RULES: