sanity check for banning sites

This commit is contained in:
Kyle Drake 2014-08-09 16:21:42 -07:00
parent aab39212ef
commit b786df44d1

View file

@ -195,6 +195,10 @@ class Site < Sequel::Model
end
def ban!
if username.nil? || username.empty?
raise 'username is missing'
end
DB.transaction {
FileUtils.mv files_path, File.join(PUBLIC_ROOT, 'banned_sites', username)
self.is_banned = true