Skip to content

Commit

Permalink
Add configurable default for projects_limit
Browse files Browse the repository at this point in the history
  • Loading branch information
peikk0 committed Jun 29, 2012
1 parent 335f9d6 commit 97d74c2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def team_update


def new
@admin_user = User.new(:projects_limit => 10)
@admin_user = User.new(:projects_limit => GITLAB_OPTS["default_projects_limit"])
end

def edit
Expand Down
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def self.find_for_ldap_auth(omniauth_info)
:name => name,
:email => email,
:password => password,
:password_confirmation => password
:password_confirmation => password,
:projects_limit => GITLAB_OPTS["default_projects_limit"]
)
end
end
Expand Down
4 changes: 4 additions & 0 deletions config/gitlab.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ git:
git_max_size: 5242880 # 5.megabytes
# Git timeout to read commit, in seconds
git_timeout: 10

# Gitlab settings
gitlab:
default_projects_limit: 10
1 change: 1 addition & 0 deletions config/initializers/00_before_all.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
GIT_HOST = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git_host"]
EMAIL_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["email"]
GIT_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["git"]
GITLAB_OPTS = YAML.load_file("#{Rails.root}/config/gitlab.yml")["gitlab"]

0 comments on commit 97d74c2

Please sign in to comment.