From 24e2f1f5d4726bc138c152672194014400ff97e4 Mon Sep 17 00:00:00 2001 From: Shayan Shiravani Date: Sat, 16 Sep 2023 22:44:13 +0330 Subject: [PATCH] Prizetap: fix ConstraintSerializer --- prizetap/serializers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prizetap/serializers.py b/prizetap/serializers.py index d53e58a7..887cafb9 100644 --- a/prizetap/serializers.py +++ b/prizetap/serializers.py @@ -3,12 +3,17 @@ from authentication.serializers import SimpleProfilerSerializer from faucet.serializers import SmallChainSerializer from .models import * +from .constants import * class ConstraintSerializer(UserConstraintBaseSerializer, serializers.ModelSerializer): class Meta(UserConstraintBaseSerializer.Meta): ref_name = "RaffleConstraint" model = Constraint + def get_params(self, constraint: UserConstraint): + c_class: ConstraintVerification = eval(constraint.name) + return [p.value for p in c_class.param_keys()] + class SimpleRaffleSerializer(serializers.ModelSerializer): class Meta: model = Raffle