summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2021-11-20 03:13:24 +0000
committerGitHub <noreply@github.com>2021-11-20 11:13:24 +0800
commit9f14fe43c6de96ce7cf81c87620fcd50e086910c (patch)
tree07ad012b753b0a1ce6afe547004ed7081befe145 /modules/context
parent52869ef386070a3f35751a71d8d2c87b012b5a6e (diff)
downloadgitea-9f14fe43c6de96ce7cf81c87620fcd50e086910c.tar.gz
gitea-9f14fe43c6de96ce7cf81c87620fcd50e086910c.zip
Fix correct usage of teams (#17732)
- `.Teams` isn't a field on the User type, thus using the seperate loaded teams. - Add a space between `PathEscape` and argument. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/org.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index 54cc3a9d8c..11521c452b 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -69,6 +69,12 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
org := ctx.Org.Organization
ctx.Data["Org"] = org
+ teams, err := org.LoadTeams()
+ if err != nil {
+ ctx.ServerError("LoadTeams", err)
+ }
+ ctx.Data["OrgTeams"] = teams
+
// Admin has super access.
if ctx.IsSigned && ctx.User.IsAdmin {
ctx.Org.IsOwner = true