Skip to content

Commit

Permalink
Update cooldown days in response (#8160)
Browse files Browse the repository at this point in the history
Co-authored-by: Saliou Diallo <saliou@audius.co>
  • Loading branch information
sddioulde and Saliou Diallo authored Apr 19, 2024
1 parent 8d8307f commit 0777866
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/discovery-provider/src/api/v1/models/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"challenge_type": fields.String(required=True),
"amount": fields.String(required=True),
"disbursed_amount": fields.Integer(required=True),
"cooldown_days": fields.Integer(),
"metadata": fields.Raw(required=True),
},
)
Expand Down
6 changes: 3 additions & 3 deletions packages/discovery-provider/src/queries/get_challenges.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def rollup_aggregates(
"is_disbursed": False, # This doesn't indicate anything for aggregate challenges
"amount": parent_challenge.amount,
"disbursed_amount": get_disbursed_amount(disbursements),
"cooldown_days": parent_challenge.cooldown_days,
"cooldown_days": parent_challenge.cooldown_days or 0,
"metadata": {},
}
return response_dict
Expand All @@ -97,7 +97,7 @@ def to_challenge_response(
"is_disbursed": disbursements is not None and len(disbursements) > 0,
"amount": challenge.amount,
"disbursed_amount": get_disbursed_amount(disbursements),
"cooldown_days": challenge.cooldown_days,
"cooldown_days": challenge.cooldown_days or 0,
"metadata": metadata,
}

Expand All @@ -119,7 +119,7 @@ def create_empty_user_challenges(
"is_disbursed": False,
"amount": challenge.amount,
"disbursed_amount": 0,
"cooldown_days": challenge.cooldown_days,
"cooldown_days": challenge.cooldown_days or 0,
"metadata": metadatas[i],
}
user_challenges.append(user_challenge)
Expand Down

0 comments on commit 0777866

Please sign in to comment.