From 21f9302d1fd932ba55d461494cba3be8cd166d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Grali=C5=84ski?= Date: Fri, 23 Nov 2018 12:49:49 +0100 Subject: [PATCH] Fix bug with the same dependency being added twice --- Handler/ShowChallenge.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Handler/ShowChallenge.hs b/Handler/ShowChallenge.hs index dca6a10..77d57a4 100644 --- a/Handler/ShowChallenge.hs +++ b/Handler/ShowChallenge.hs @@ -295,9 +295,9 @@ doCreateSubmission userId challengeId mDescription mTags repoSpec chan = do externalLinkTitle = linkTitle l, externalLinkUrl = linkUrl l }) $ gonitoMetadataExternalLinks gonitoMetadata - _ <- runDB $ mapM insert $ map (\s -> Dependency { - dependencySubRepoCommit = s, - dependencySuperRepoCommit = (repoCurrentCommit repo) }) $ gonitoMetadataDependencies gonitoMetadata + _ <- runDB $ mapM insertUnique $ map (\s -> Dependency { + dependencySubRepoCommit = s, + dependencySuperRepoCommit = (repoCurrentCommit repo) }) $ gonitoMetadataDependencies gonitoMetadata outs <- getOuts chan submissionId (gonitoMetadataGeneralParams gonitoMetadata)