Sign up page is not redirected correctly if ghost user is added after upgrading and migrating databases.

Summary

Sign up page is not redirected correctly if ghost user is added after upgrading and migrating databases.

Steps to reproduce

  1. install gitlab version < 11.0.4. Do not reset admin password.
  2. Upgrade to 11.0.4.

What is the current bug behavior?

Sign up page is not redirected to edit user password page after upgrading.

What is the expected correct behavior?

Sign up page should be redirected to edit user password page.

Possible fixes

Upgrade and migrate database(20170825104051_migrate_issues_to_ghost_user.rb) would add ghost user to users table.

In this line, check_initial_setup would not redirect to edit user password page if there are more than one user in Users table.

return unless User.limit(2).count == 1 # Count as much 2 to know if we have exactly one

It should ignore ghost user.

return unless User.where(ghost: nil).limit(2).count == 1 # Count as much 2 to know if we have exactly one none ghost user

Assignee Loading
Time tracking Loading