|
|
|
@ -275,10 +275,12 @@ func deleteOrg(e *xorm.Session, u *User) error {
|
|
|
|
|
return fmt.Errorf("Failed to RemoveAll %s: %v", path, err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
avatarPath := u.CustomAvatarPath() |
|
|
|
|
if com.IsExist(avatarPath) { |
|
|
|
|
if err := os.Remove(avatarPath); err != nil { |
|
|
|
|
return fmt.Errorf("Failed to remove %s: %v", avatarPath, err) |
|
|
|
|
if len(u.Avatar) > 0 { |
|
|
|
|
avatarPath := u.CustomAvatarPath() |
|
|
|
|
if com.IsExist(avatarPath) { |
|
|
|
|
if err := os.Remove(avatarPath); err != nil { |
|
|
|
|
return fmt.Errorf("Failed to remove %s: %v", avatarPath, err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|