Merge pull request 'fix(api): raise 403 on scouting auth failure instead of returning 200 (#213)' (#214) from issue/213-fix-api-scouting-endpoints-return-200-on-auth-fail into main
Reviewed-on: #214
This commit is contained in:
commit
cd8db3f98e
@ -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