X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/80f576a29b2dd45757c48740a74683c699648c05..3c4f32a76075e91d60efd82c91bd64ebff5b6082:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 9cc8b7d83..42fa40e53 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -104,6 +104,8 @@ class User < ApplicationRecord validates :preferred_editor, :inclusion => Editors::ALL_EDITORS, :allow_nil => true validates :auth_uid, :unless => proc { |u| u.auth_provider.nil? }, :uniqueness => { :scope => :auth_provider } + validates :avatar, :if => proc { |u| u.attachment_changes["avatar"] }, + :image => true validates_email_format_of :email, :if => proc { |u| u.email_changed? } validates_email_format_of :new_email, :allow_blank => true, :if => proc { |u| u.new_email_changed? }