Skip to content

Commit

Permalink
Prizetap: fix ConstraintSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayanShiravani committed Sep 16, 2023
1 parent 78583d3 commit 24e2f1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prizetap/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24e2f1f

Please sign in to comment.