File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def home():
15
15
16
16
# get field values from the form
17
17
chess_username = request .form ["chess_username" ]
18
- chess_username = chess_username if chess_username else " "
18
+ chess_username = chess_username . strip () if chess_username else " " # Clean the string input with .strip().
19
19
num_lookback_days = request .form ["num_lookback_days" ]
20
20
platform = request .form ["platform" ]
21
21
logger .debug (f"platform: { platform } " )
Original file line number Diff line number Diff line change @@ -123,7 +123,8 @@ def is_lichess_user(lichess_username):
123
123
124
124
125
125
def is_chessdotcom_user (chessdotcom_username ):
126
- player_dict = json .loads (requests .get (f"https://api.chess.com/pub/player/{ chessdotcom_username } " ).content )
126
+ url = f"https://api.chess.com/pub/player/{ chessdotcom_username } "
127
+ player_dict = json .loads (requests .get (url ).content )
127
128
if "player_id" in player_dict :
128
129
return True
129
130
return False
You can’t perform that action at this time.
0 commit comments