1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-20 15:31:12 +00:00

Don't return 2 errors when identifier is blank (blank + too short).

git-svn-id: http://svn.redmine.org/redmine/trunk@15987 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2016-11-19 10:50:03 +00:00
parent 4d7dde7f4e
commit d19aea9437

View File

@ -72,7 +72,7 @@ class Project < ActiveRecord::Base
validates_uniqueness_of :identifier, :if => Proc.new {|p| p.identifier_changed?} validates_uniqueness_of :identifier, :if => Proc.new {|p| p.identifier_changed?}
validates_length_of :name, :maximum => 255 validates_length_of :name, :maximum => 255
validates_length_of :homepage, :maximum => 255 validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH
# downcase letters, digits, dashes but not digits only # downcase letters, digits, dashes but not digits only
validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :if => Proc.new { |p| p.identifier_changed? } validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :if => Proc.new { |p| p.identifier_changed? }
# reserved words # reserved words