Commit b8ecc996 authored by James Edwards-Jones's avatar James Edwards-Jones
Browse files

Replace @user with current_user on Account page

Previously we used @user, but this changed to local_assigns[:user]
so we could pass a second variable to the view from an EE module

Since we were already using current_user librally there it makes sense
to replace the remaining usages.

See: https://docs.gitlab.com/ee/development/module_with_instance_variables.html
parent cd12a553e4ed
......@@ -27,6 +27,6 @@ def unlink
private
def show_view_variables
{ user: current_user }
{}
end
end
- page_title "Account"
- @content_class = "limit-container-width" unless fluid_layout
- user = local_assigns.fetch(:user)
- if current_user.ldap_user?
.alert.alert-info
......@@ -68,7 +67,7 @@
%h4.prepend-top-0.danger-title
= s_('Profiles|Delete account')
.col-lg-8
- if user.can_be_removed? && can?(current_user, :destroy_user, user)
- if current_user.can_be_removed? && can?(current_user, :destroy_user, current_user)
%p
= s_('Profiles|Deleting an account has the following effects:')
= render 'users/deletion_guidance', user: current_user
......@@ -81,10 +80,10 @@
confirm_with_password: ('true' if current_user.confirm_deletion_with_password?),
username: current_user.username } }
- else
- if user.solo_owned_groups.present?
- if current_user.solo_owned_groups.present?
%p
= s_('Profiles|Your account is currently an owner in these groups:')
%strong= user.solo_owned_groups.map(&:name).join(', ')
%strong= current_user.solo_owned_groups.map(&:name).join(', ')
%p
= s_('Profiles|You must transfer ownership or delete these groups before you can delete your account.')
- else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment