Skip to content

Commit

Permalink
banned users are visible to /people page for admin (#2247)
Browse files Browse the repository at this point in the history
* banned users are visible to /people page for admin

fixes #2246

* test fixes
  • Loading branch information
ViditChitkara authored and jywarren committed Feb 20, 2018
1 parent b2b9390 commit 313848a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def list
@users = DrupalUser.select('*, MAX(node.changed) AS last_updated')
.joins(:node)
.group('users.uid')
.where('users.status = 1 AND node.status = 1')
.where('node.status = 1')
.order("last_updated DESC")
.page(params[:page])
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/users/list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<td style="padding-top:16px;"><%= distance_of_time_in_words(user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %></td>
<% if current_user && (current_user.role == "admin" || current_user.role == "moderator") %>
<td style="padding-top:16px;">
<% if user.status == 0 %>
<% if user.user.status == 0 %>
<i class='fa fa-ban' style="color:#a00;"></i> <%= t('users.list.banned') %>
<% elsif user.status == 1 %>
<% elsif user.user.status == 1 %>
<a class="btn btn-default btn-sm" data-confirm="<%= t('users.list.are_you_sure') %>" href="/ban/<%= user.uid %>" ><i class='fa fa-ban'></i> <%= t('users.list.ban') %></a>
<% end %>
</td>
Expand Down

0 comments on commit 313848a

Please sign in to comment.