File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,18 @@ func checkContextUser(ctx *context.Context, uid int64) *models.User {
62
62
return nil
63
63
}
64
64
65
+ if ! ctx .User .IsAdmin {
66
+ orgsAvailable := []* models.User {}
67
+ for i := 0 ; i < len (orgs ); i ++ {
68
+ if orgs [i ].CanCreateRepo () {
69
+ orgsAvailable = append (orgsAvailable , orgs [i ])
70
+ }
71
+ }
72
+ ctx .Data ["Orgs" ] = orgsAvailable
73
+ } else {
74
+ ctx .Data ["Orgs" ] = orgs
75
+ }
76
+
65
77
// Not equal means current user is an organization.
66
78
if uid == ctx .User .ID || uid == 0 {
67
79
return ctx .User
@@ -83,14 +95,6 @@ func checkContextUser(ctx *context.Context, uid int64) *models.User {
83
95
return nil
84
96
}
85
97
if ! ctx .User .IsAdmin {
86
- orgsAvailable := []* models.User {}
87
- for i := 0 ; i < len (orgs ); i ++ {
88
- if orgs [i ].CanCreateRepo () {
89
- orgsAvailable = append (orgsAvailable , orgs [i ])
90
- }
91
- }
92
- ctx .Data ["Orgs" ] = orgsAvailable
93
-
94
98
canCreate , err := org .CanCreateOrgRepo (ctx .User .ID )
95
99
if err != nil {
96
100
ctx .ServerError ("CanCreateOrgRepo" , err )
You can’t perform that action at this time.
0 commit comments