File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -832,10 +832,9 @@ func CreateUser(u *User) (err error) {
832
832
return err
833
833
}
834
834
u .HashPassword (u .Passwd )
835
- u .AllowCreateOrganization = setting .Service .DefaultAllowCreateOrganization
835
+ u .AllowCreateOrganization = setting .Service .DefaultAllowCreateOrganization && ! setting . Admin . DisableRegularOrgCreation
836
836
u .MaxRepoCreation = - 1
837
837
u .Theme = setting .UI .DefaultTheme
838
- u .AllowCreateOrganization = ! setting .Admin .DisableRegularOrgCreation
839
838
840
839
if _ , err = sess .Insert (u ); err != nil {
841
840
return err
Original file line number Diff line number Diff line change @@ -261,6 +261,8 @@ func TestCreateUser_Issue5882(t *testing.T) {
261
261
{
& User {
Name :
"GiteaBot2" ,
Email :
"[email protected] " ,
Passwd :
passwd ,
MustChangePassword :
false },
true },
262
262
}
263
263
264
+ setting .Service .DefaultAllowCreateOrganization = true
265
+
264
266
for _ , v := range tt {
265
267
setting .Admin .DisableRegularOrgCreation = v .disableOrgCreation
266
268
You can’t perform that action at this time.
0 commit comments