Show error message if user add failed.
This commit is contained in:
parent
b5a263ab90
commit
cceb87bc53
1 changed files with 8 additions and 6 deletions
|
@ -298,12 +298,12 @@ class UserNew extends App.ControllerModal
|
|||
headPrefix: 'New'
|
||||
|
||||
content: ->
|
||||
controller = new App.ControllerForm(
|
||||
@controller = new App.ControllerForm(
|
||||
model: App.User
|
||||
screen: 'edit'
|
||||
autofocus: true
|
||||
)
|
||||
controller.form
|
||||
@controller.form
|
||||
|
||||
onSubmit: (e) =>
|
||||
params = @formParam(e.target)
|
||||
|
@ -341,6 +341,8 @@ class UserNew extends App.ControllerModal
|
|||
ui.close()
|
||||
App.User.full(@id, callbackReload , true)
|
||||
|
||||
fail: ->
|
||||
ui.close()
|
||||
fail: (settings, details) ->
|
||||
ui.log 'errors', details
|
||||
ui.formEnable(e)
|
||||
ui.controller.showAlert(details.error_human || details.error || 'Unable to create object!')
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue