X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bd1420a7c51b7d1c3a64bc02756393c7ad2025f5..6f09f5d49ce117c0f34c7c82b80b19fdccb873cf:/app/models/user.rb?ds=sidebyside 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? }