Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1d605010
Commit
1d605010
authored
Feb 19, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly set default projects limit for new users.
parent
3c2139ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
app/models/user.rb
app/models/user.rb
+9
-2
No files found.
app/models/user.rb
View file @
1d605010
...
...
@@ -55,14 +55,13 @@ class User < ActiveRecord::Base
include
Gitlab
::
ConfigHelper
include
TokenAuthenticatable
extend
Gitlab
::
ConfigHelper
extend
Gitlab
::
CurrentSettings
include
Gitlab
::
CurrentSettings
default_value_for
:admin
,
false
default_value_for
:can_create_group
,
gitlab_config
.
default_can_create_group
default_value_for
:can_create_team
,
false
default_value_for
:hide_no_ssh_key
,
false
default_value_for
:hide_no_password
,
false
default_value_for
:projects_limit
,
current_application_settings
.
default_projects_limit
default_value_for
:theme_id
,
gitlab_config
.
default_theme
devise
:database_authenticatable
,
:lockable
,
:async
,
...
...
@@ -141,6 +140,7 @@ class User < ActiveRecord::Base
before_save
:ensure_authentication_token
after_save
:ensure_namespace_correct
after_initialize
:set_projects_limit
after_create
:post_create_hook
after_destroy
:post_destroy_hook
...
...
@@ -463,6 +463,13 @@ class User < ActiveRecord::Base
end
end
def
set_projects_limit
connection_default_value_defined
=
new_record?
&&
!
projects_limit_changed?
return
unless
self
.
projects_limit
.
nil?
||
connection_default_value_defined
self
.
projects_limit
=
current_application_settings
.
default_projects_limit
end
def
requires_ldap_check?
if
!
Gitlab
.
config
.
ldap
.
enabled
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment