diff --git a/app/routers_v2/battingcardratings.py b/app/routers_v2/battingcardratings.py index d881d04..32b9168 100644 --- a/app/routers_v2/battingcardratings.py +++ b/app/routers_v2/battingcardratings.py @@ -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"): diff --git a/app/routers_v2/pitchingcardratings.py b/app/routers_v2/pitchingcardratings.py index 78153b4..c1285f9 100644 --- a/app/routers_v2/pitchingcardratings.py +++ b/app/routers_v2/pitchingcardratings.py @@ -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):