Unified link creation. (#15619)
This commit is contained in:
parent
1456978246
commit
c80d7f33b6
11 changed files with 27 additions and 24 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue