From 282d56a5c248a3a879dae5bbd461212cdeea3e57 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 30 Nov 2020 12:26:33 +0100 Subject: [PATCH] refactor: minor --- src/Handler/Utils/Workflow/Form.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Handler/Utils/Workflow/Form.hs b/src/Handler/Utils/Workflow/Form.hs index 8c9ce7acc..d5da60e2c 100644 --- a/src/Handler/Utils/Workflow/Form.hs +++ b/src/Handler/Utils/Workflow/Form.hs @@ -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