]> source.dussan.org Git - redmine.git/commitdiff
migrate_from_trac.rake does not properly parse First Name and Last Name (#14592).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 25 Sep 2013 17:49:58 +0000 (17:49 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 25 Sep 2013 17:49:58 +0000 (17:49 +0000)
Patch by Craig Rodrigues.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12164 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/migrate_from_trac.rake

index ece967d6521bb873dfbb02cb738b0c41c55aecee..a429a944e4cb058c97c626974208da07a86f474f 100644 (file)
@@ -249,8 +249,8 @@ namespace :redmine do
           if name_attr = TracSessionAttribute.find_by_sid_and_name(username, 'name')
             name = name_attr.value
           end
-          name =~ (/(.*)(\s+\w+)?/)
-          fn = $1.strip
+          name =~ (/(\w+)(\s+\w+)?/)
+          fn = ($1 || "-").strip
           ln = ($2 || '-').strip
 
           u = User.new :mail => mail.gsub(/[^-@a-z0-9\.]/i, '-'),