Skip to content

Commit

Permalink
Merge pull request #164 from UnitapApp/feature/gastap_dynamic_round_d…
Browse files Browse the repository at this point in the history
…uration

fix remaining claims error
  • Loading branch information
Mohamad Bastin authored Oct 27, 2023
2 parents 190b2f7 + d75610c commit 85cb263
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 85cb263

Please sign in to comment.