Description:
fix bugs when user creation error
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r812:e2597379728c - - 1 file changed: 1 inserted, 1 deleted
@@ -60,25 +60,25 | |||
|
60 | 60 | |
|
61 | 61 | |
|
62 | 62 | #add to group |
|
63 | 63 | if params[:add_to_group] |
|
64 | 64 | group = Group.find_by(id: params[:group_id])&.add_users_skip_existing(ok_user) |
|
65 | 65 | end |
|
66 | 66 | |
|
67 | 67 | # show flash |
|
68 | 68 | if ok_user.count > 0 |
|
69 | 69 | flash[:success] = "#{ok_user.count} user(s) was created or updated successfully" |
|
70 | 70 | end |
|
71 | 71 | if error_logins.size > 0 |
|
72 |
- flash[:error] = "Following user(s) failed to be created: " + error_ |
|
|
72 | + flash[:error] = "Following user(s) failed to be created: " + error_logins.join(', ') + ". The error of the first failed one are: " + error_msg; | |
|
73 | 73 | end |
|
74 | 74 | redirect_to :action => 'index' |
|
75 | 75 | end |
|
76 | 76 | |
|
77 | 77 | def edit |
|
78 | 78 | @user = User.find(params[:id]) |
|
79 | 79 | end |
|
80 | 80 | |
|
81 | 81 | def update |
|
82 | 82 | @user = User.find(params[:id]) |
|
83 | 83 | if @user.update_attributes(user_params) |
|
84 | 84 | flash[:notice] = 'User was successfully updated.' |
You need to be logged in to leave comments.
Login now