summaryrefslogtreecommitdiffstats
path: root/modules/context/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/org.go')
-rw-r--r--modules/context/org.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index 8e292fa1c5..f8607bd29f 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -8,7 +8,7 @@ package context
import (
"strings"
- "code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/organization"
"code.gitea.io/gitea/models/perm"
user_model "code.gitea.io/gitea/models/user"
)
@@ -19,12 +19,12 @@ type Organization struct {
IsMember bool
IsTeamMember bool // Is member of team.
IsTeamAdmin bool // In owner team or team that has admin permission level.
- Organization *models.Organization
+ Organization *organization.Organization
OrgLink string
CanCreateOrgRepo bool
- Team *models.Team
- Teams []*models.Team
+ Team *organization.Team
+ Teams []*organization.Team
}
// HandleOrgAssignment handles organization assignment
@@ -51,9 +51,9 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
orgName := ctx.Params(":org")
var err error
- ctx.Org.Organization, err = models.GetOrgByName(orgName)
+ ctx.Org.Organization, err = organization.GetOrgByName(orgName)
if err != nil {
- if models.IsErrOrgNotExist(err) {
+ if organization.IsErrOrgNotExist(err) {
redirectUserID, err := user_model.LookupUserRedirect(orgName)
if err == nil {
RedirectToUser(ctx, orgName, redirectUserID)
@@ -120,7 +120,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
ctx.Data["IsOrganizationOwner"] = ctx.Org.IsOwner
ctx.Data["IsOrganizationMember"] = ctx.Org.IsMember
ctx.Data["IsPublicMember"] = func(uid int64) bool {
- is, _ := models.IsPublicMembership(ctx.Org.Organization.ID, uid)
+ is, _ := organization.IsPublicMembership(ctx.Org.Organization.ID, uid)
return is
}
ctx.Data["CanCreateOrgRepo"] = ctx.Org.CanCreateOrgRepo