Support org/user level projects (#22235)
Fix #13405 <img width="1151" alt="image" src="https://user-images.githubusercontent.com/81045/209442911-7baa3924-c389-47b6-b63b-a740803e640e.png"> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
0c048e554b
commit
6fe3c8b398
30 changed files with 1556 additions and 176 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
org_model "code.gitea.io/gitea/models/organization"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
)
|
||||
|
@ -56,6 +57,14 @@ func userAssignment(ctx *context.Context, errCb func(int, string, interface{}))
|
|||
} else {
|
||||
errCb(http.StatusInternalServerError, "GetUserByName", err)
|
||||
}
|
||||
} else {
|
||||
if ctx.ContextUser.IsOrganization() {
|
||||
if ctx.Org == nil {
|
||||
ctx.Org = &context.Organization{}
|
||||
}
|
||||
ctx.Org.Organization = (*org_model.Organization)(ctx.ContextUser)
|
||||
ctx.Data["Org"] = ctx.Org.Organization
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue