users: temp fix exception when is_banned is inconsistent.

Fix an exception when is_banned is true but the user doesn't have a ban
record.
This commit is contained in:
evazion
2020-02-04 03:47:07 -06:00
parent fcfdd94fe9
commit 96b565f61d

View File

@@ -29,7 +29,7 @@
<% if CurrentUser.user.is_moderator? %>
<%= subnav_link_to "Promote", edit_admin_user_path(@user) %>
<% if @user.is_banned? %>
<% if @user.is_banned? && @user.recent_ban.present? %>
<%= subnav_link_to "Unban", ban_path(@user.recent_ban) %>
<% else %>
<%= subnav_link_to "Ban", new_ban_path(:ban => {:user_id => @user.id}) %>