mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-22 17:01:57 +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
|
<*> areq textField "Stackage ID" { fsName = Just "snapshot" } Nothing
|
||||||
case res of
|
case res of
|
||||||
FormSuccess (fi, snapshot) -> do
|
FormSuccess (fi, snapshot) -> do
|
||||||
Entity _sid stackage <-
|
Entity _sid stackage <- runDB $ do
|
||||||
runDB $ getBy404 $ UniqueStackage $ PackageSetIdent snapshot
|
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
|
bs <- fileSource fi $$ foldC
|
||||||
case Y.decodeEither bs of
|
case Y.decodeEither bs of
|
||||||
Left e -> invalidArgs [pack e]
|
Left e -> invalidArgs [pack e]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user