fix del org avatar potential delete all avtars (#1120)
This commit is contained in:
parent
7b64b2ddab
commit
0376029241
1 changed files with 6 additions and 4 deletions
|
@ -275,10 +275,12 @@ func deleteOrg(e *xorm.Session, u *User) error {
|
||||||
return fmt.Errorf("Failed to RemoveAll %s: %v", path, err)
|
return fmt.Errorf("Failed to RemoveAll %s: %v", path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
avatarPath := u.CustomAvatarPath()
|
if len(u.Avatar) > 0 {
|
||||||
if com.IsExist(avatarPath) {
|
avatarPath := u.CustomAvatarPath()
|
||||||
if err := os.Remove(avatarPath); err != nil {
|
if com.IsExist(avatarPath) {
|
||||||
return fmt.Errorf("Failed to remove %s: %v", avatarPath, err)
|
if err := os.Remove(avatarPath); err != nil {
|
||||||
|
return fmt.Errorf("Failed to remove %s: %v", avatarPath, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue