fixes #1029
This commit is contained in:
@@ -35,7 +35,7 @@ class UploadsController < ApplicationController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
@upload = Upload.create(params[:upload].merge(:server => Socket.gethostname))
|
@upload = Upload.create(params[:upload].merge(:server => Socket.gethostname))
|
||||||
@upload.process! if @upload.errors.empty?
|
@upload.process! if @upload.errors.empty?
|
||||||
respond_with(@upload)
|
respond_with(@upload)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class User < ActiveRecord::Base
|
|||||||
validates_presence_of :email, :if => lambda {|rec| rec.new_record? && Danbooru.config.enable_email_verification?}
|
validates_presence_of :email, :if => lambda {|rec| rec.new_record? && Danbooru.config.enable_email_verification?}
|
||||||
validates_presence_of :comment_threshold
|
validates_presence_of :comment_threshold
|
||||||
validate :validate_ip_addr_is_not_banned, :on => :create
|
validate :validate_ip_addr_is_not_banned, :on => :create
|
||||||
validate :validate_feedback_on_name_change, :on => :update
|
|
||||||
before_validation :normalize_blacklisted_tags
|
before_validation :normalize_blacklisted_tags
|
||||||
before_create :encrypt_password_on_create
|
before_create :encrypt_password_on_create
|
||||||
before_update :encrypt_password_on_update
|
before_update :encrypt_password_on_update
|
||||||
@@ -111,13 +110,6 @@ class User < ActiveRecord::Base
|
|||||||
rescue Exception
|
rescue Exception
|
||||||
# swallow, since it'll be expired eventually anyway
|
# swallow, since it'll be expired eventually anyway
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_feedback_on_name_change
|
|
||||||
if feedback.negative.count > 0 && name_changed?
|
|
||||||
self.errors[:base] << "You can not change your name if you have any negative feedback"
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module PasswordMethods
|
module PasswordMethods
|
||||||
@@ -407,10 +399,8 @@ class User < ActiveRecord::Base
|
|||||||
def upload_limited_reason
|
def upload_limited_reason
|
||||||
if created_at > 1.week.ago
|
if created_at > 1.week.ago
|
||||||
"cannot upload during your first week of registration"
|
"cannot upload during your first week of registration"
|
||||||
elsif upload_limit <= 0
|
|
||||||
"can only upload #{upload_limit} posts a day"
|
|
||||||
else
|
else
|
||||||
nil
|
"can not upload until your pending posts have been approved"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user