Skip to content

Commit

Permalink
fix remaining claims error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamad Bastin committed Oct 27, 2023
1 parent 8654374 commit d75610c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions authentication/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Meta:

class ProfileSerializer(serializers.ModelSerializer):
wallets = WalletSerializer(many=True, read_only=True)
total_weekly_claims_remaining = serializers.SerializerMethodField()
total_round_claims_remaining = serializers.SerializerMethodField()
token = serializers.SerializerMethodField()

class Meta:
Expand All @@ -65,15 +65,15 @@ class Meta:
"initial_context_id",
"is_meet_verified",
"is_aura_verified",
"total_weekly_claims_remaining",
"total_round_claims_remaining",
"wallets",
]

def get_token(self, instance):
token, bol = Token.objects.get_or_create(user=instance.user)
return token.key

def get_total_weekly_claims_remaining(self, instance):
def get_total_round_claims_remaining(self, instance):
gs = GlobalSettings.objects.first()
if gs is not None:
return gs.gastap_round_claim_limit - LimitedChainClaimManager.get_total_round_claims(instance)
Expand Down

0 comments on commit d75610c

Please sign in to comment.