summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-12 03:46:08 +0800
committerUnknwon <u@gogs.io>2015-08-12 03:46:08 +0800
commitcafde1287ebb58ad6b862e3cc4ef7d4dece82ddb (patch)
treedec09984ed0f0d97a5656b3c7dbe7b1cfa9e2474
parentd1a82a82b463271532f629d35f3f9fd0dfe5823b (diff)
downloadgitea-cafde1287ebb58ad6b862e3cc4ef7d4dece82ddb.tar.gz
gitea-cafde1287ebb58ad6b862e3cc4ef7d4dece82ddb.zip
delete avatar when del user
-rw-r--r--models/user.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index d5ee5c432e..a58bb634d9 100644
--- a/models/user.go
+++ b/models/user.go
@@ -553,10 +553,12 @@ func DeleteUser(u *User) error {
return err
}
- // Delete user directory.
+ // Delete user data.
if err = os.RemoveAll(UserPath(u.Name)); err != nil {
return err
}
+ // Delete avatar.
+ os.Remove(u.CustomAvatarPath())
return sess.Commit()
}