diff --git a/CTFd/api/v1/challenges.py b/CTFd/api/v1/challenges.py index bbdc57b..9868476 100644 --- a/CTFd/api/v1/challenges.py +++ b/CTFd/api/v1/challenges.py @@ -378,7 +378,7 @@ class ChallengeAttempt(Resource): log( "submissions", "[{date}] {name} submitted {submission} on {challenge_id} with kpm {kpm} [TOO FAST]", - submission=request_data["submission"].encode("utf-8"), + submission=request_data.get("submission", "").encode("utf-8"), challenge_id=challenge_id, kpm=kpm, ) @@ -425,7 +425,7 @@ class ChallengeAttempt(Resource): log( "submissions", "[{date}] {name} submitted {submission} on {challenge_id} with kpm {kpm} [CORRECT]", - submission=request_data["submission"].encode("utf-8"), + submission=request_data.get("submission", "").encode("utf-8"), challenge_id=challenge_id, kpm=kpm, ) @@ -443,7 +443,7 @@ class ChallengeAttempt(Resource): log( "submissions", "[{date}] {name} submitted {submission} on {challenge_id} with kpm {kpm} [WRONG]", - submission=request_data["submission"].encode("utf-8"), + submission=request_data.get("submission", "").encode("utf-8"), challenge_id=challenge_id, kpm=kpm, ) @@ -477,7 +477,7 @@ class ChallengeAttempt(Resource): log( "submissions", "[{date}] {name} submitted {submission} on {challenge_id} with kpm {kpm} [ALREADY SOLVED]", - submission=request_data["submission"].encode("utf-8"), + submission=request_data.get("submission", "").encode("utf-8"), challenge_id=challenge_id, kpm=kpm, )