Allow multiple banishes on the same account (#3326)
* Allow banished users to be banished again * Remove deprecated method banished
This commit is contained in:
parent
86b0777938
commit
ea139e5ca5
2 changed files with 1 additions and 7 deletions
|
|
@ -310,10 +310,6 @@ class User < ApplicationRecord
|
|||
has_role? :warned
|
||||
end
|
||||
|
||||
def banished?
|
||||
user.notes.where(reason: "banned", content: "spam account").any? && user.banned && user.comments.none? && user.articles.none?
|
||||
end
|
||||
|
||||
def admin?
|
||||
has_role?(:super_admin)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<h2>Banish User</h2>
|
||||
<% if @user.banished? %>
|
||||
<p>User has been banished.</p>
|
||||
<% elsif @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %>
|
||||
<% if @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue