diff --git a/models/user/user.go b/models/user/user.go index 07d8177b6..2077d55f5 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -406,6 +406,11 @@ func (u *User) IsIndividual() bool { return u.Type == UserTypeIndividual } +// IsBot returns whether or not the user is of type bot +func (u *User) IsBot() bool { + return u.Type == UserTypeBot +} + // DisplayName returns full name if it's not empty, // returns username otherwise. func (u *User) DisplayName() string { diff --git a/templates/shared/user/authorlink.tmpl b/templates/shared/user/authorlink.tmpl index 71cbb8676..64ccc62cd 100644 --- a/templates/shared/user/authorlink.tmpl +++ b/templates/shared/user/authorlink.tmpl @@ -1 +1 @@ -{{.GetDisplayName}} +{{.GetDisplayName}}{{if .IsBot}}bot{{end}}