Don't discard the value of DISABLE_REGULAR_ORG_CREATION (#5886)

* Consider the configuration value of DISABLE_REGULAR_ORG_CREATION when
creating a user
This commit is contained in:
Lanre Adelowo 2019-01-30 18:04:14 +01:00 committed by techknowlogick
parent 7933a950d0
commit 6dc2f401c9
2 changed files with 45 additions and 0 deletions

View file

@ -814,6 +814,7 @@ func CreateUser(u *User) (err error) {
u.AllowCreateOrganization = setting.Service.DefaultAllowCreateOrganization
u.MaxRepoCreation = -1
u.Theme = setting.UI.DefaultTheme
u.AllowCreateOrganization = !setting.Admin.DisableRegularOrgCreation
if _, err = sess.Insert(u); err != nil {
return err