diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-12-04 13:17:21 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-12-04 18:14:34 +0300 |
commit | 84352177d454e1a8dfa952efca65558501bd9c7d (patch) | |
tree | 7813f8aae0ef1a3f83fd345b9f8bc4acc4b30fe4 /app/views/profiles | |
parent | 5978b98c5f50bf0a2f9ffb14d950d9a93b14ca4b (diff) |
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
Diffstat (limited to 'app/views/profiles')
-rw-r--r-- | app/views/profiles/accounts/show.html.haml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml index fffdc305623..e167e094240 100644 --- a/app/views/profiles/accounts/show.html.haml +++ b/app/views/profiles/accounts/show.html.haml @@ -1,6 +1,5 @@ - 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 |