incognitolm commited on
Commit
1a50057
·
verified ·
1 Parent(s): 38cfb33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -163,7 +163,7 @@ async def handle_action(request: Request):
163
  player_found = True
164
  # If gain permission is not available, then income has already been taken.
165
  if not game["permissions"].get(player, {}).get("gain", True):
166
- raise HTTPException(status_code=403, detail="You already took coins, and cannot take income.")
167
  p["coins"] += 1
168
  game["permissions"][player]["gain"] = False
169
  return {"success": True, "message": f"Player {player} now has {p['coins']} coins."}
 
163
  player_found = True
164
  # If gain permission is not available, then income has already been taken.
165
  if not game["permissions"].get(player, {}).get("gain", True):
166
+ return {"success": False, "message": "You can only earn money once per turn."}
167
  p["coins"] += 1
168
  game["permissions"][player]["gain"] = False
169
  return {"success": True, "message": f"Player {player} now has {p['coins']} coins."}