fixes to banhammer

This commit is contained in:
Kyle Drake 2013-06-23 00:06:52 -07:00
parent 41b214b99f
commit c68cbeb5a4
3 changed files with 5 additions and 3 deletions

3
app.rb
View file

@ -234,7 +234,8 @@ post '/admin/banhammer' do
DB.transaction {
FileUtils.mv site_base_path(site.username), File.join(settings.public_folder, 'banned_sites', site.username)
site.update is_banned: true
site.is_banned = true
site.save(validate: false)
}
flash[:success] = 'MISSION ACCOMPLISHED'

View file

@ -77,7 +77,7 @@ class Site < Sequel::Model
errors.add :over_capacity, 'We are currently at capacity, and cannot create your home page. We will fix this shortly. Please come back later and try again, our apologies.'
end
if values[:username].nil? || values[:username].empty? || values[:username].match(BAD_USERNAME_REGEX) # || USERNAME_SHITLIST.include?(values[:username])
if new? && (values[:username].nil? || values[:username].empty? || values[:username].match(BAD_USERNAME_REGEX)) # || USERNAME_SHITLIST.include?(values[:username])
errors.add :username, 'A valid username is required.'
end

View file

@ -16,4 +16,5 @@
.span6
h2 Banned Terrorists
- @banned_sites.each do |banned_site|
= banned_site.username
= banned_site.username
br