diff options
author | KN4CK3R <KN4CK3R@users.noreply.github.com> | 2021-04-30 19:25:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-30 19:25:13 +0200 |
commit | c80d7f33b67ad1beff7378bcba3aa44ac84669e9 (patch) | |
tree | c479207edb2a5fe0f03d6f5d25b256a244d0dbea /models/user.go | |
parent | 1456978246c263acd6523534cf36b35f5ddbe0eb (diff) | |
download | gitea-c80d7f33b67ad1beff7378bcba3aa44ac84669e9.tar.gz gitea-c80d7f33b67ad1beff7378bcba3aa44ac84669e9.zip |
Unified link creation. (#15619)
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go index 6665782d35..26cfc0804e 100644 --- a/models/user.go +++ b/models/user.go @@ -301,7 +301,7 @@ func (u *User) CanImportLocal() bool { // DashboardLink returns the user dashboard page link. func (u *User) DashboardLink() string { if u.IsOrganization() { - return setting.AppSubURL + "/org/" + u.Name + "/dashboard/" + return u.OrganisationLink() + "/dashboard/" } return setting.AppSubURL + "/" } @@ -316,6 +316,11 @@ func (u *User) HTMLURL() string { return setting.AppURL + u.Name } +// OrganisationLink returns the organization sub page link. +func (u *User) OrganisationLink() string { + return setting.AppSubURL + "/org/" + u.Name +} + // GenerateEmailActivateCode generates an activate code based on user information and given e-mail. func (u *User) GenerateEmailActivateCode(email string) string { code := base.CreateTimeLimitCode( |