mirror of
https://github.com/neocities/neocities.git
synced 2025-08-06 09:34:57 +02:00
method for unbanning
This commit is contained in:
parent
82462b2461
commit
0afe4f6df3
2 changed files with 23 additions and 0 deletions
|
@ -505,6 +505,14 @@ class Site < Sequel::Model
|
|||
is_banned
|
||||
end
|
||||
|
||||
def unban!
|
||||
undelete!
|
||||
self.is_banned = false
|
||||
self.banned_at = nil
|
||||
self.blackbox_whitelisted = true
|
||||
save validate: false
|
||||
end
|
||||
|
||||
def ban!
|
||||
if username.nil? || username.empty?
|
||||
raise 'username is missing'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue