summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorChristopher Brickley <brickley@gmail.com>2014-09-17 09:11:51 -0400
committerChristopher Brickley <brickley@gmail.com>2014-09-17 09:20:14 -0400
commitf94d7c3f51969d300c3ee1ffdecd642363c207b4 (patch)
treed0ae8728dd3296f2b85f200fcfe7894be48046fa /models/user.go
parent061a879cea39a1cce56dcb394b912fad50d7b77a (diff)
downloadgitea-f94d7c3f51969d300c3ee1ffdecd642363c207b4.tar.gz
gitea-f94d7c3f51969d300c3ee1ffdecd642363c207b4.zip
clarify name/username/owner/pusher for webhook
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 96881ea355..b3ea816177 100644
--- a/models/user.go
+++ b/models/user.go
@@ -167,6 +167,14 @@ func (u *User) GetOrganizations() error {
return nil
}
+// GetFullNameFallback returns Full Name if set, otherwise username
+func (u *User) GetFullNameFallback() string {
+ if u.FullName == "" {
+ return u.Name
+ }
+ return u.FullName
+}
+
// IsUserExist checks if given user name exist,
// the user name should be noncased unique.
func IsUserExist(name string) (bool, error) {