Trac importer: handle nil usernames.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1125 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-02-06 19:05:42 +00:00
parent 68d3305ae2
commit 943ba3e34f
1 changed files with 2 additions and 0 deletions

View File

@ -157,6 +157,8 @@ namespace :redmine do
end
def self.find_or_create_user(username, project_member = false)
return User.anonymous if username.blank?
u = User.find_by_login(username)
if !u
# Create a new user if not found