summaryrefslogtreecommitdiffstats
path: root/services/context/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/context/user.go')
-rw-r--r--services/context/user.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/context/user.go b/services/context/user.go
index 9dc84c3ac1..7642cba4e1 100644
--- a/services/context/user.go
+++ b/services/context/user.go
@@ -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
+ }
}
}
}