From 94582c7f6a694f85c3b1d41ea7017f9cea841271 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 7 Sep 2014 07:03:06 +0200 Subject: [PATCH] fixed forgotten things --- Handler/NewAlbum.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Handler/NewAlbum.hs b/Handler/NewAlbum.hs index 0a20048..d2ca28e 100644 --- a/Handler/NewAlbum.hs +++ b/Handler/NewAlbum.hs @@ -23,7 +23,7 @@ postNewAlbumR = do msu <- lookupSession "userId" case msu of Just tempUserId -> do - userId <- lift $ pure $ getUserIdFromText tempUserId + userId <- return $ getUserIdFromText tempUserId ((result, albumWidget), enctype) <- runFormPost (albumForm userId) case result of FormSuccess album -> do @@ -39,6 +39,12 @@ postNewAlbumR = do -- outro setMessage $ "Album successfully created" redirect $ ProfileR userId + _ -> do + setMessage "There was an error creating the album" + redirect $ NewAlbumR + Nothing -> do + setMessage "You must be logged in to create albums" + redirect $ LoginR albumForm :: UserId -> Form Album albumForm userId = renderDivs $ Album