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
|
((res, _), _) <- runFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm transferForm
|
$ renderBootstrap3 BootstrapBasicForm transferForm
|
||||||
case res of
|
case res of
|
||||||
FormSuccess amount -> do
|
FormSuccess amount
|
||||||
if amount < 0
|
| amount < 0 -> do
|
||||||
then do
|
|
||||||
setMessageI MsgNegativeTransfer
|
setMessageI MsgNegativeTransfer
|
||||||
redirect $ TransferR from to
|
redirect $ TransferR from to
|
||||||
else do
|
| userBalance sender < amount -> do
|
||||||
|
setMessageI MsgNotEnoughFunds
|
||||||
|
redirect HomeR
|
||||||
|
| otherwise -> do
|
||||||
runDB $ update from [UserBalance -=. amount]
|
runDB $ update from [UserBalance -=. amount]
|
||||||
runDB $ update to [UserBalance +=. amount]
|
runDB $ update to [UserBalance +=. amount]
|
||||||
master <- getYesod
|
master <- getYesod
|
||||||
|
|
|
@ -146,3 +146,4 @@ UserIdentNotUnique: Uživatelské jméno není jedinečný
|
||||||
Login: Přihlásit
|
Login: Přihlásit
|
||||||
Logout: Odhlásit
|
Logout: Odhlásit
|
||||||
CreationBlocked: Nelze vytvořit nové uživatele.
|
CreationBlocked: Nelze vytvořit nové uživatele.
|
||||||
|
NotEnoughFunds: Nedostatek kreditu
|
||||||
|
|
|
@ -146,3 +146,4 @@ UserIdentNotUnique: Benutzername ist nicht einzigartig
|
||||||
Login: Login
|
Login: Login
|
||||||
Logout: Logout
|
Logout: Logout
|
||||||
CreationBlocked: Es können keine neuen Nutzer angelegt werden.
|
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
|
Login: Login
|
||||||
Logout: Logout
|
Logout: Logout
|
||||||
CreationBlocked: New users can not be created.
|
CreationBlocked: New users can not be created.
|
||||||
|
NotEnoughFunds: Not enough funds!
|
||||||
|
|
Loading…
Reference in a new issue