Error 500 on user creation if Projects Limit is extremely high
Created by: rikai
Fresh Gitlab install, tried setting an extremely high project limit in http://example.net/admin/users/new, in this case '99999999999999999999999', and got the following error:
Started POST "/admin/users" for 24.31.136.31 at 2014-03-11 14:50:20 -0400
Processing by Admin::UsersController#create as HTML
Parameters: {"utf8"=>"â", "authenticity_token"=>"removed", "user"=>{"name"=>"rikai", "username"=>"rikai", "email"=>"[email protected]", "projects_limit"=>"99999999999999999999999",$
PG::Error: ERROR: value "99999999999999999999999" is out of range for type integer
: INSERT INTO "users" ("admin", "authentication_token", "confirmed_at", "created_at", "created_by_id", "email", "encrypted_password", "name", "password_expires_at", "projects_limit", "skype", "state", "theme_id", "twitter", $
Completed 500 Internal Server Error in 112ms
ActiveRecord::StatementInvalid (PG::Error: ERROR: value "99999999999999999999999" is out of range for type integer
: INSERT INTO "users" ("admin", "authentication_token", "confirmed_at", "created_at", "created_by_id", "email", "encrypted_password", "name", "password_expires_at", "projects_limit", "skype", "state", "theme_id", "twitter", $
app/controllers/admin/users_controller.rb:50:in `create'
app/controllers/application_controller.rb:57:in `set_current_user_for_thread'
Seems like at the very least, that field should have a cap on the number you can enter. ;)