fix(api): raise 403 on scouting auth failure instead of returning 200 (#213)
Closes #213 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5e85e27cda
commit
6a986bf0f8
@ -332,10 +332,13 @@ async def get_card_scouting(team_id: int, ts: str):
|
||||
logging.debug(f"Team: {this_team} / has_guide: {this_team.has_guide}")
|
||||
if this_team is None or ts != this_team.team_hash() or this_team.has_guide != 1:
|
||||
logging.warning(f"Team_id {team_id} attempted to pull ratings")
|
||||
return (
|
||||
"Your team does not have the ratings guide enabled. If you have purchased a copy ping Cal to "
|
||||
"make sure it is enabled on your team. If you are interested you can pick it up here (thank you!): "
|
||||
"https://ko-fi.com/manticorum/shop"
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail=(
|
||||
"Your team does not have the ratings guide enabled. If you have purchased a copy ping Cal to "
|
||||
"make sure it is enabled on your team. If you are interested you can pick it up here (thank you!): "
|
||||
"https://ko-fi.com/manticorum/shop"
|
||||
),
|
||||
)
|
||||
|
||||
if os.path.isfile("storage/batting-ratings.csv"):
|
||||
|
||||
@ -252,10 +252,13 @@ async def get_card_scouting(team_id: int, ts: str):
|
||||
logging.debug(f"Team: {this_team} / has_guide: {this_team.has_guide}")
|
||||
if this_team is None or ts != this_team.team_hash() or this_team.has_guide != 1:
|
||||
logging.warning(f"Team_id {team_id} attempted to pull ratings")
|
||||
return (
|
||||
"Your team does not have the ratings guide enabled. If you have purchased a copy ping Cal to "
|
||||
"make sure it is enabled on your team. If you are interested you can pick it up here (thank you!): "
|
||||
"https://ko-fi.com/manticorum/shop"
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail=(
|
||||
"Your team does not have the ratings guide enabled. If you have purchased a copy ping Cal to "
|
||||
"make sure it is enabled on your team. If you are interested you can pick it up here (thank you!): "
|
||||
"https://ko-fi.com/manticorum/shop"
|
||||
),
|
||||
)
|
||||
|
||||
if os.path.isfile(RATINGS_FILE):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user