Skip to content

Commit

Permalink
Merge branch 'dev' into zamilmajdy/fix-long-description-block
Browse files Browse the repository at this point in the history
  • Loading branch information
majdyz authored Nov 18, 2024
2 parents 3557f8d + 6fa4b8c commit b59554b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autogpt_platform/backend/backend/server/routers/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def execute_graph_block(block_id: str, data: BlockInput) -> CompletedBlockOutput
async def get_user_credits(
user_id: Annotated[str, Depends(get_user_id)]
) -> dict[str, int]:
return {"credits": await _user_credit_model.get_or_refill_credit(user_id)}
# Credits can go negative, so ensure it's at least 0 for user to see.
return {"credits": max(await _user_credit_model.get_or_refill_credit(user_id), 0)}


########################################################
Expand Down

0 comments on commit b59554b

Please sign in to comment.