From d22e1056fbf35ba841b598831c099c340984bfa7 Mon Sep 17 00:00:00 2001 From: Wen Date: Wed, 22 Jan 2014 21:05:57 +0800 Subject: [PATCH] xxxxx --- app/models/user.rb | 4 ++-- app/views/account/register.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 723e7cbf..53aacd23 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -130,13 +130,13 @@ class User < Principal LOGIN_LENGTH_LIMIT = 60 MAIL_LENGTH_LIMIT = 60 - validates_presence_of :login, :firstname, :lastname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) } + validates_presence_of :login, :firstname, :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_changed? && user.mail.present? }, :case_sensitive => false # Login must contain letters, numbers, underscores only validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT - validates_length_of :firstname, :lastname, :maximum => 30 + validates_length_of :firstname, :maximum => 30 validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true validates_confirmation_of :password, :allow_nil => true diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index fc325c90..2e82dcd1 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -287,7 +287,7 @@ <% end %>