Unified link creation. (#15619)

This commit is contained in:
KN4CK3R 2021-04-30 19:25:13 +02:00 committed by GitHub
parent 1456978246
commit c80d7f33b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 27 additions and 24 deletions

View file

@ -9,7 +9,6 @@ import (
"strings"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
)
// Organization contains organization context
@ -70,7 +69,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
// Force redirection when username is actually a user.
if !org.IsOrganization() {
ctx.Redirect(setting.AppSubURL + "/" + org.Name)
ctx.Redirect(org.HomeLink())
return
}
@ -118,7 +117,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
ctx.Data["IsOrganizationMember"] = ctx.Org.IsMember
ctx.Data["CanCreateOrgRepo"] = ctx.Org.CanCreateOrgRepo
ctx.Org.OrgLink = setting.AppSubURL + "/org/" + org.Name
ctx.Org.OrgLink = org.OrganisationLink()
ctx.Data["OrgLink"] = ctx.Org.OrgLink
// Team.