Skip to content

Commit

Permalink
GRN2-268: Fixed redirection after executing an action in Manage Users (
Browse files Browse the repository at this point in the history
…bigbluebutton#967)

* GRN2-268: Fixed redirection after executing an action in Manage Users

* GRN2-268: rubocop fix
  • Loading branch information
etiennevvv authored Feb 28, 2020
1 parent 50f4d5e commit edcda54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def merge_user
flash[:success] = I18n.t("administrator.flash.merge_success")
end

redirect_to admins_path
redirect_back fallback_location: admins_path
end

# SITE SETTINGS
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ def update
# DELETE /u/:user_uid
def destroy
# Include deleted users in the check
admin_path = request.referer.present? ? request.referer : admins_path
@user = User.include_deleted.find_by(uid: params[:user_uid])

logger.info "Support: #{current_user.email} is deleting #{@user.email}."

self_delete = current_user == @user
redirect_url = self_delete ? root_path : admins_path
redirect_url = self_delete ? root_path : admin_path

begin
if current_user && (self_delete || current_user.admin_of?(@user))
Expand Down

0 comments on commit edcda54

Please sign in to comment.