@@ -426,8 +426,8 class MailHandler < ActionMailer::Base | |||
|
426 | 426 | assign_string_attribute_with_limit(user, 'login', email_address, User::LOGIN_LENGTH_LIMIT) |
|
427 | 427 | |
|
428 | 428 | names = fullname.blank? ? email_address.gsub(/@.*$/, '').split('.') : fullname.split |
|
429 | assign_string_attribute_with_limit(user, 'firstname', names.shift) | |
|
430 | assign_string_attribute_with_limit(user, 'lastname', names.join(' ')) | |
|
429 | assign_string_attribute_with_limit(user, 'firstname', names.shift, 30) | |
|
430 | assign_string_attribute_with_limit(user, 'lastname', names.join(' '), 30) | |
|
431 | 431 | user.lastname = '-' if user.lastname.blank? |
|
432 | 432 | |
|
433 | 433 | password_length = [Setting.password_min_length.to_i, 10].max |
@@ -437,7 +437,7 class MailHandler < ActionMailer::Base | |||
|
437 | 437 | unless user.valid? |
|
438 | 438 | user.login = "user#{Redmine::Utils.random_hex(6)}" unless user.errors[:login].blank? |
|
439 | 439 | user.firstname = "-" unless user.errors[:firstname].blank? |
|
440 | user.lastname = "-" unless user.errors[:lastname].blank? | |
|
440 | (puts user.errors[:lastname];user.lastname = "-") unless user.errors[:lastname].blank? | |
|
441 | 441 | end |
|
442 | 442 | |
|
443 | 443 | user |
General Comments 0
You need to be logged in to leave comments.
Login now