Handle logging situation where a submission isn't provided to challenge attempt

1318-submissions-api-improvements
Kevin Chung 2020-04-17 01:48:09 -04:00
parent e113b2d627
commit ccefe47468
1 changed files with 4 additions and 4 deletions

View File

@ -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,
)