summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-27 19:25:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-27 19:25:56 +0000
commit6c0f3cd5d4a89cb30934837ba452d119aededd53 (patch)
tree7d755798b5d40efefde5df0e0db26d95abf03211 /app/models
parent04dcdb3290e0af847011d2c026579d255c1f4a6b (diff)
downloadredmine-6c0f3cd5d4a89cb30934837ba452d119aededd53.tar.gz
redmine-6c0f3cd5d4a89cb30934837ba452d119aededd53.zip
Validate email only if changed.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10883 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 264cbd14c..261487230 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -97,7 +97,7 @@ class User < Principal
validates_presence_of :login, :firstname, :lastname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
- validates_uniqueness_of :mail, :if => Proc.new { |user| !user.mail.blank? }, :case_sensitive => false
+ validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
# Login must contain lettres, numbers, underscores only
validates_format_of :login, :with => /^[a-z0-9_\-@\.]*$/i
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT