From 389a01825445d99b489dfb91faeb207473830752 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Wed, 4 Mar 2020 08:35:59 +0100 Subject: [PATCH] Fix issue with multiple evaluation results --- Handler/Shared.hs | 6 ++++-- config/models | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Handler/Shared.hs b/Handler/Shared.hs index 952f136..21dde16 100644 --- a/Handler/Shared.hs +++ b/Handler/Shared.hs @@ -553,5 +553,7 @@ fetchTheEvaluation out version = do case evals' of [eval] -> return $ Just eval [] -> return Nothing - _ -> error "More than evaluation for the same test and version!" - _ -> error "More than evaluation for the same test, checksum and version!" + _ -> error ("More than 1 evaluation for the same test and version!" ++ (show evals)) + (eval:_) -> return $ Just eval + +-- -> error ("More than 1 evaluation for the same test, checksum and version!" ++ (show evals)) diff --git a/config/models b/config/models index 3e111e0..bf0d689 100644 --- a/config/models +++ b/config/models @@ -128,6 +128,7 @@ Evaluation stamp UTCTime default=now() -- Should be just SHA1 (without Maybe) - Maybe is just a legacy version SHA1 Maybe + deriving Show Comment challenge ChallengeId author UserId