Skip to content

Commit

Permalink
Only update the user if the validation passes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalis committed Jan 30, 2018
1 parent ae717d6 commit 952a378
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/ops_controller/ops_rbac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def rbac_edit_save_or_add(what, rbac_suffix = what)
when :user
record = @edit[:user_id] ? User.find_by(:id => @edit[:user_id]) : User.new
validated = rbac_user_validate?
rbac_user_set_record_vars(record)
rbac_user_set_record_vars(record) if validated
when :group then
record = @edit[:group_id] ? MiqGroup.find_by(:id => @edit[:group_id]) : MiqGroup.new
validated = rbac_group_validate?
Expand Down

0 comments on commit 952a378

Please sign in to comment.