Fix bug with the same dependency being added twice

This commit is contained in:
Filip Graliński 2018-11-23 12:49:49 +01:00
parent ccae7e284f
commit 21f9302d1f

View File

@ -295,7 +295,7 @@ doCreateSubmission userId challengeId mDescription mTags repoSpec chan = do
externalLinkTitle = linkTitle l, externalLinkTitle = linkTitle l,
externalLinkUrl = linkUrl l }) $ gonitoMetadataExternalLinks gonitoMetadata externalLinkUrl = linkUrl l }) $ gonitoMetadataExternalLinks gonitoMetadata
_ <- runDB $ mapM insert $ map (\s -> Dependency { _ <- runDB $ mapM insertUnique $ map (\s -> Dependency {
dependencySubRepoCommit = s, dependencySubRepoCommit = s,
dependencySuperRepoCommit = (repoCurrentCommit repo) }) $ gonitoMetadataDependencies gonitoMetadata dependencySuperRepoCommit = (repoCurrentCommit repo) }) $ gonitoMetadataDependencies gonitoMetadata