aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/context/org.go1
-rw-r--r--modules/context/repo.go1
-rw-r--r--routers/web/org/home.go1
-rw-r--r--routers/web/org/members.go1
-rw-r--r--routers/web/org/setting.go1
-rw-r--r--routers/web/org/teams.go1
-rw-r--r--routers/web/repo/packages.go1
-rw-r--r--routers/web/shared/user/header.go1
-rw-r--r--routers/web/user/code.go1
-rw-r--r--services/context/user.go1
10 files changed, 3 insertions, 7 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index 2d7cf5185c..7638ffdd3f 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -250,6 +250,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
return
}
}
+ ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["CanReadProjects"] = ctx.Org.CanReadUnit(ctx, unit.TypeProjects)
ctx.Data["CanReadPackages"] = ctx.Org.CanReadUnit(ctx, unit.TypePackages)
diff --git a/modules/context/repo.go b/modules/context/repo.go
index f5c56cf833..8a16d311b1 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -471,6 +471,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc {
}
ctx.Repo.Owner = owner
ctx.ContextUser = owner
+ ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["Username"] = ctx.Repo.Owner.Name
// redirect link to wiki
diff --git a/routers/web/org/home.go b/routers/web/org/home.go
index 613dff2182..a69fdedba4 100644
--- a/routers/web/org/home.go
+++ b/routers/web/org/home.go
@@ -152,7 +152,6 @@ func Home(ctx *context.Context) {
pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "language", "Language")
ctx.Data["Page"] = pager
- ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0
diff --git a/routers/web/org/members.go b/routers/web/org/members.go
index fae8b48128..3c073211ae 100644
--- a/routers/web/org/members.go
+++ b/routers/web/org/members.go
@@ -62,7 +62,6 @@ func Members(ctx *context.Context) {
}
ctx.Data["Page"] = pager
ctx.Data["Members"] = members
- ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["MembersIsPublicMember"] = membersIsPublic
ctx.Data["MembersIsUserOrgOwner"] = organization.IsUserOrgOwner(members, org.ID)
ctx.Data["MembersTwoFaStatus"] = members.GetTwoFaStatus()
diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go
index 957daab646..51d5282fa0 100644
--- a/routers/web/org/setting.go
+++ b/routers/web/org/setting.go
@@ -45,7 +45,6 @@ func Settings(ctx *context.Context) {
ctx.Data["PageIsSettingsOptions"] = true
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
ctx.Data["RepoAdminChangeTeamAccess"] = ctx.Org.Organization.RepoAdminChangeTeamAccess
- ctx.Data["ContextUser"] = ctx.ContextUser
ctx.HTML(http.StatusOK, tplSettingsOptions)
}
diff --git a/routers/web/org/teams.go b/routers/web/org/teams.go
index 3b07bba713..fecb0cd5e9 100644
--- a/routers/web/org/teams.go
+++ b/routers/web/org/teams.go
@@ -56,7 +56,6 @@ func Teams(ctx *context.Context) {
}
}
ctx.Data["Teams"] = ctx.Org.Teams
- ctx.Data["ContextUser"] = ctx.ContextUser
ctx.HTML(http.StatusOK, tplTeams)
}
diff --git a/routers/web/repo/packages.go b/routers/web/repo/packages.go
index 6ad2f71b5c..ac9e64d774 100644
--- a/routers/web/repo/packages.go
+++ b/routers/web/repo/packages.go
@@ -58,7 +58,6 @@ func Packages(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("packages.title")
ctx.Data["IsPackagesPage"] = true
- ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["Query"] = query
ctx.Data["PackageType"] = packageType
ctx.Data["AvailableTypes"] = packages.TypeList
diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go
index 9b1918ed16..6273e11fc5 100644
--- a/routers/web/shared/user/header.go
+++ b/routers/web/shared/user/header.go
@@ -22,7 +22,6 @@ import (
func prepareContextForCommonProfile(ctx *context.Context) {
ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
- ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["EnableFeed"] = setting.Other.EnableFeed
ctx.Data["FeedURL"] = ctx.ContextUser.HomeLink()
}
diff --git a/routers/web/user/code.go b/routers/web/user/code.go
index 033f65c9c0..29b8b91c89 100644
--- a/routers/web/user/code.go
+++ b/routers/web/user/code.go
@@ -30,7 +30,6 @@ func CodeSearch(ctx *context.Context) {
ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["Title"] = ctx.Tr("explore.code")
- ctx.Data["ContextUser"] = ctx.ContextUser
language := ctx.FormTrim("l")
keyword := ctx.FormTrim("q")
diff --git a/services/context/user.go b/services/context/user.go
index 62d2dc0aa2..81c2746819 100644
--- a/services/context/user.go
+++ b/services/context/user.go
@@ -27,6 +27,7 @@ func UserAssignmentWeb() func(ctx *context.Context) {
}
}
ctx.ContextUser = userAssignment(ctx.Base, ctx.Doer, errorFn)
+ ctx.Data["ContextUser"] = ctx.ContextUser
}
}