Commit cfee2fc9e4a07f1aca7df369e3a6f39856193b3f
Exists in
master
and in
4 other branches
Merge pull request #1011 from peikk0/config_projects_limit
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
@@ -31,3 +31,7 @@ git: | @@ -31,3 +31,7 @@ git: | ||
31 | git_max_size: 5242880 # 5.megabytes | 31 | git_max_size: 5242880 # 5.megabytes |
32 | # Git timeout to read commit, in seconds | 32 | # Git timeout to read commit, in seconds |
33 | git_timeout: 10 | 33 | git_timeout: 10 |
34 | + | ||
35 | +# Gitlab settings | ||
36 | +gitlab: | ||
37 | + 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"] |