mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
More sanity in docmap uploading
This commit is contained in:
parent
bc147c85e2
commit
3ee2110602
@ -314,8 +314,15 @@ getUploadDocMapR = do
|
||||
<*> areq textField "Stackage ID" { fsName = Just "snapshot" } Nothing
|
||||
case res of
|
||||
FormSuccess (fi, snapshot) -> do
|
||||
Entity _sid stackage <-
|
||||
runDB $ getBy404 $ UniqueStackage $ PackageSetIdent snapshot
|
||||
Entity _sid stackage <- runDB $ do
|
||||
ment <- getBy $ UniqueStackage $ PackageSetIdent snapshot
|
||||
case ment of
|
||||
Just ent -> return ent
|
||||
Nothing -> do
|
||||
slug <- maybe notFound return $ fromPathPiece snapshot
|
||||
getBy404 $ UniqueSnapshot slug
|
||||
unless (stackageHasHaddocks stackage) $ invalidArgs $ return
|
||||
"Cannot use a snapshot without docs for a docmap"
|
||||
bs <- fileSource fi $$ foldC
|
||||
case Y.decodeEither bs of
|
||||
Left e -> invalidArgs [pack e]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user