Browse Source

Bug fixed for org avatar caused by #1049 (#1070)

* bug fixed for org avatar caused by #1049

* use isfile only
tags/v1.1.0
Lunny Xiao 7 years ago
parent
commit
522f194983
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      models/user.go

+ 2
- 2
models/user.go View File

@@ -324,12 +324,12 @@ func (u *User) RelAvatarLink() string {

switch {
case u.UseCustomAvatar:
if !com.IsExist(u.CustomAvatarPath()) {
if !com.IsFile(u.CustomAvatarPath()) {
return defaultImgURL
}
return setting.AppSubURL + "/avatars/" + u.Avatar
case setting.DisableGravatar, setting.OfflineMode:
if !com.IsExist(u.CustomAvatarPath()) {
if !com.IsFile(u.CustomAvatarPath()) {
if err := u.GenerateRandomAvatar(); err != nil {
log.Error(3, "GenerateRandomAvatar: %v", err)
}

Loading…
Cancel
Save