fix for #103
This commit is contained in:
parent
752fafae15
commit
a6a30a7705
4 changed files with 9 additions and 4 deletions
|
@ -47,12 +47,14 @@ postTransferR from to =
|
|||
((res, _), _) <- runFormPost
|
||||
$ renderBootstrap3 BootstrapBasicForm transferForm
|
||||
case res of
|
||||
FormSuccess amount -> do
|
||||
if amount < 0
|
||||
then do
|
||||
FormSuccess amount
|
||||
| amount < 0 -> do
|
||||
setMessageI MsgNegativeTransfer
|
||||
redirect $ TransferR from to
|
||||
else do
|
||||
| userBalance sender < amount -> do
|
||||
setMessageI MsgNotEnoughFunds
|
||||
redirect HomeR
|
||||
| otherwise -> do
|
||||
runDB $ update from [UserBalance -=. amount]
|
||||
runDB $ update to [UserBalance +=. amount]
|
||||
master <- getYesod
|
||||
|
|
|
@ -146,3 +146,4 @@ UserIdentNotUnique: Uživatelské jméno není jedinečný
|
|||
Login: Přihlásit
|
||||
Logout: Odhlásit
|
||||
CreationBlocked: Nelze vytvořit nové uživatele.
|
||||
NotEnoughFunds: Nedostatek kreditu
|
||||
|
|
|
@ -146,3 +146,4 @@ UserIdentNotUnique: Benutzername ist nicht einzigartig
|
|||
Login: Login
|
||||
Logout: Logout
|
||||
CreationBlocked: Es können keine neuen Nutzer angelegt werden.
|
||||
NotEnoughFunds: Nicht genügen Guthaben
|
||||
|
|
|
@ -146,3 +146,4 @@ UserIdentNotUnique: Username is not unique
|
|||
Login: Login
|
||||
Logout: Logout
|
||||
CreationBlocked: New users can not be created.
|
||||
NotEnoughFunds: Not enough funds!
|
||||
|
|
Loading…
Reference in a new issue