diff options
author | Ethan Koenig <ethantkoenig@gmail.com> | 2017-06-29 12:10:33 -0400 |
---|---|---|
committer | Ethan Koenig <ethantkoenig@gmail.com> | 2017-06-29 12:10:33 -0400 |
commit | 05e37264154bbcb375b358798c7a8f9b499c4881 (patch) | |
tree | 7942fd4a0b55795b7fb19c2e028ea54e637c7cf4 /models | |
parent | 23f072887935a6aa81634ef487432ff2b5fa250a (diff) | |
download | gitea-05e37264154bbcb375b358798c7a8f9b499c4881.tar.gz gitea-05e37264154bbcb375b358798c7a8f9b499c4881.zip |
Use default avatar on error
Diffstat (limited to 'models')
-rw-r--r-- | models/user.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go index 6484c8cf69..2a4fb557db 100644 --- a/models/user.go +++ b/models/user.go @@ -333,15 +333,14 @@ func (u *User) generateRandomAvatar(e Engine) error { // which includes app sub-url as prefix. However, it is possible // to return full URL if user enables Gravatar-like service. func (u *User) RelAvatarLink() string { - defaultImgURL := setting.AppSubURL + "/img/avatar_default.png" if u.ID == -1 { - return defaultImgURL + return base.DefaultAvatarLink() } switch { case u.UseCustomAvatar: if !com.IsFile(u.CustomAvatarPath()) { - return defaultImgURL + return base.DefaultAvatarLink() } return setting.AppSubURL + "/avatars/" + u.Avatar case setting.DisableGravatar, setting.OfflineMode: |