web: dodge a yesod-core regression breaking add form redirect (#53)

This commit is contained in:
Simon Michael 2012-01-12 15:44:32 +00:00
parent 1b834afb20
commit 0bd7fffaf7
2 changed files with 3 additions and 4 deletions

View File

@ -509,15 +509,14 @@ handleAdd = do
$forall e<-errs $forall e<-errs
#{e}<br> #{e}<br>
|] |]
getRegisterR
Right t -> do Right t -> do
let t' = txnTieKnot t -- XXX move into balanceTransaction let t' = txnTieKnot t -- XXX move into balanceTransaction
liftIO $ do ensureJournalFile journalpath liftIO $ do ensureJournalFile journalpath
appendToJournalFileOrStdout journalpath $ showTransaction t' appendToJournalFileOrStdout journalpath $ showTransaction t'
-- setMessage $ toHtml $ (printf "Added transaction:\n%s" (show t') :: String) -- setMessage $ toHtml $ (printf "Added transaction:\n%s" (show t') :: String)
setMessage [$shamlet|<span>Added transaction:<small><pre>#{chomp $ show t'}</pre></small>|] setMessage [$shamlet|<span>Added transaction:<small><pre>#{chomp $ show t'}</pre></small>|]
getRegisterR
redirectParams RedirectTemporary RegisterR [("add","1")]
chomp :: String -> String chomp :: String -> String
chomp = reverse . dropWhile (`elem` "\r\n") . reverse chomp = reverse . dropWhile (`elem` "\r\n") . reverse

View File

@ -92,7 +92,7 @@ executable hledger-web
,template-haskell >= 2.4 && < 2.7 ,template-haskell >= 2.4 && < 2.7
,yesod >= 0.9.2.1 && < 0.10 ,yesod >= 0.9.2.1 && < 0.10
,yesod-core ,yesod-core >= 0.9.4.1 && < 0.10
,yesod-form ,yesod-form
,yesod-json ,yesod-json
,yesod-static >= 0.3 ,yesod-static >= 0.3