Project

General

Profile

Actions

Bug #1613

closed

Email address format validation preventing admin user creation

Added by Andy Shinn almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DB migrations
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

Description

On both RPM versions 0.4.2-0.1 and 0.5.1-1 the admin user is being created with the Auth type not set. On 0.4.2, without the :login setting, I can browse to the dashboard which logs me in as admin. If I then enable :login and refresh the dashboard I am automatically logged in and can see that the admin user has no Auth type set.

When I try to reset the admin user I receive the following Mail is invalid error

[root@foreman1 foreman]# rake -t -v permissions:reset RAILS_ENV=production 
Libvirt binding are missing - hypervisor management is disabled
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8
** Invoke permissions:reset (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute permissions:reset
Mail is invalid

I am able to bypass the error by commenting out the validation in the user model:

# validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_nil => true

This happens both with a domain of localdomain or localdomain.mydomain.com. The latter appears to pass with email address . I am not sure what may be failing.

This is on CentOS 6 x86_64 using foreman-installer.

Actions

Also available in: Atom PDF