Commit 97d74c2adc71a9144840573d87a796dc46cc2511
1 parent
335f9d64
Exists in
master
and in
4 other branches
Add configurable default for projects_limit
Showing
4 changed files
with
8 additions
and
2 deletions
Show diff stats
app/controllers/admin/users_controller.rb
@@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController | @@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController | ||
34 | 34 | ||
35 | 35 | ||
36 | def new | 36 | def new |
37 | - @admin_user = User.new(:projects_limit => 10) | 37 | + @admin_user = User.new(:projects_limit => GITLAB_OPTS["default_projects_limit"]) |
38 | end | 38 | end |
39 | 39 | ||
40 | def edit | 40 | def edit |
app/models/user.rb
@@ -90,7 +90,8 @@ class User < ActiveRecord::Base | @@ -90,7 +90,8 @@ class User < ActiveRecord::Base | ||
90 | :name => name, | 90 | :name => name, |
91 | :email => email, | 91 | :email => email, |
92 | :password => password, | 92 | :password => password, |
93 | - :password_confirmation => password | 93 | + :password_confirmation => password, |
94 | + :projects_limit => GITLAB_OPTS["default_projects_limit"] | ||
94 | ) | 95 | ) |
95 | end | 96 | end |
96 | end | 97 | end |
config/gitlab.yml.example
@@ -27,3 +27,7 @@ git: | @@ -27,3 +27,7 @@ git: | ||
27 | git_max_size: 5242880 # 5.megabytes | 27 | git_max_size: 5242880 # 5.megabytes |
28 | # Git timeout to read commit, in seconds | 28 | # Git timeout to read commit, in seconds |
29 | git_timeout: 10 | 29 | git_timeout: 10 |
30 | + | ||
31 | +# Gitlab settings | ||
32 | +gitlab: | ||
33 | + default_projects_limit: 10 |
config/initializers/00_before_all.rb
1 | GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"] | 1 | GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"] |
2 | EMAIL_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["email"] | 2 | EMAIL_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["email"] |
3 | GIT_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git"] | 3 | GIT_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git"] |
4 | +GITLAB_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["gitlab"] |