assign_string_attribute_with_limit(user, 'login', email_address, User::LOGIN_LENGTH_LIMIT)
names = fullname.blank? ? email_address.gsub(/@.*$/, '').split('.') : fullname.split
- assign_string_attribute_with_limit(user, 'firstname', names.shift)
- assign_string_attribute_with_limit(user, 'lastname', names.join(' '))
+ assign_string_attribute_with_limit(user, 'firstname', names.shift, 30)
+ assign_string_attribute_with_limit(user, 'lastname', names.join(' '), 30)
user.lastname = '-' if user.lastname.blank?
password_length = [Setting.password_min_length.to_i, 10].max
unless user.valid?
user.login = "user#{Redmine::Utils.random_hex(6)}" unless user.errors[:login].blank?
user.firstname = "-" unless user.errors[:firstname].blank?
- user.lastname = "-" unless user.errors[:lastname].blank?
+ (puts user.errors[:lastname];user.lastname = "-") unless user.errors[:lastname].blank?
end
user