mirror of https://github.com/JohnHammond/CTFd.git
Handle logging situation where a submission isn't provided to challenge attempt
parent
e113b2d627
commit
ccefe47468
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue