]> source.dussan.org Git - redmine.git/commitdiff
Do not authorize project identifier with numbers only (would be interpreted as the...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 2 Feb 2008 15:51:48 +0000 (15:51 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 2 Feb 2008 15:51:48 +0000 (15:51 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1108 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb

index 42f2ddfd91a57b1bec4610328d2e5c7b0f54237d..73a8d640413800b458981497de21729e9aedb631 100644 (file)
@@ -217,6 +217,7 @@ protected
   def validate
     errors.add(parent_id, " must be a root project") if parent and parent.parent
     errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
+    errors.add(:identifier, :activerecord_error_invalid) if !identifier.blank? && identifier.match(/^\d*$/)
   end
   
 private