fixed recharge error

This commit is contained in:
nek0 2016-03-18 05:38:03 +01:00
parent e1d43876fe
commit d76b7995f0

View file

@ -17,7 +17,6 @@ module Handler.Select where
import Import
import Handler.Common
import qualified Text.Read as R
import qualified Data.Text as T
import Data.Maybe
@ -69,9 +68,8 @@ postRechargeR uId = do
redirect $ RechargeR uId
else do
updateCashier amount ("Guthaben: " `T.append` userIdent user)
time <- liftIO getCurrentTime
let secs = R.read $ formatTime defaultTimeLocale "%s" time
runDB $ update uId [UserBalance +=. amount, UserTimestamp =. secs]
today <- liftIO $ return . utctDay =<< getCurrentTime
runDB $ update uId [UserBalance +=. amount, UserTimestamp =. today]
setMessageI MsgRecharged
redirect HomeR
_ -> do