From 09253f8f2fab369c66657136c89aff6a3afa0c6d Mon Sep 17 00:00:00 2001 From: Shayan Shiravani Date: Sat, 18 Nov 2023 17:21:59 +0330 Subject: [PATCH] Use get_constraint in createRaffle serializer --- prizetap/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prizetap/serializers.py b/prizetap/serializers.py index 2230f8ee..a914b528 100644 --- a/prizetap/serializers.py +++ b/prizetap/serializers.py @@ -115,7 +115,7 @@ def validate(self, data): data["constraint_params"] = base64.b64decode(data["constraint_params"]).decode("utf-8") if len(constraints) != 0: for c in constraints: - constraint_class: ConstraintVerification = eval(c.name) + constraint_class: ConstraintVerification = get_constraint(c.name) try: if len(constraint_class.param_keys()) != 0: constraint_class.is_valid_param_keys(constraint_params[c.name])