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 @@ -849,10 +849,9 @@ func CreateUser(u *User) (err error) {
849
849
return err
850
850
}
851
851
u .HashPassword (u .Passwd )
852
- u .AllowCreateOrganization = setting .Service .DefaultAllowCreateOrganization
852
+ u .AllowCreateOrganization = setting .Service .DefaultAllowCreateOrganization && ! setting . Admin . DisableRegularOrgCreation
853
853
u .MaxRepoCreation = - 1
854
854
u .Theme = setting .UI .DefaultTheme
855
- u .AllowCreateOrganization = ! setting .Admin .DisableRegularOrgCreation
856
855
857
856
if _ , err = sess .Insert (u ); err != nil {
858
857
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