mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
sanity check for banning sites
This commit is contained in:
parent
aab39212ef
commit
b786df44d1
1 changed files with 4 additions and 0 deletions
|
@ -195,6 +195,10 @@ class Site < Sequel::Model
|
||||||
end
|
end
|
||||||
|
|
||||||
def ban!
|
def ban!
|
||||||
|
if username.nil? || username.empty?
|
||||||
|
raise 'username is missing'
|
||||||
|
end
|
||||||
|
|
||||||
DB.transaction {
|
DB.transaction {
|
||||||
FileUtils.mv files_path, File.join(PUBLIC_ROOT, 'banned_sites', username)
|
FileUtils.mv files_path, File.join(PUBLIC_ROOT, 'banned_sites', username)
|
||||||
self.is_banned = true
|
self.is_banned = true
|
||||||
|
|
Loading…
Add table
Reference in a new issue