refactor: minor

This commit is contained in:
Gregor Kleen 2020-11-30 12:26:33 +01:00
parent 48208c9105
commit 282d56a5c2

View File

@ -122,9 +122,7 @@ workflowGraphForm template = validateAForm validateWorkflowGraphForm . hoistAFor
[fRef] -> return fRef
_other -> throwE $ SomeMessage MsgWorkflowGraphFormInvalidNumberOfFiles
mContent <- for (fileContent $ sourceFile fRef) $ \fContent -> lift . runDB . runConduit $ fContent .| C.fold
content <- case mContent of
Nothing -> throwE $ SomeMessage MsgWorkflowGraphFormUploadIsDirectory
Just c -> return c
content <- maybe (throwE $ SomeMessage MsgWorkflowGraphFormUploadIsDirectory) return mContent
either (throwE . SomeMessage . MsgYAMLFieldDecodeFailure . displayException) return . runCatch $ Yaml.decodeThrow content
fromGraph :: WorkflowGraph FileIdent CryptoUUIDUser -> FileUploads
fromGraph g = yieldM . runDB $ do