From cafde1287ebb58ad6b862e3cc4ef7d4dece82ddb Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 12 Aug 2015 03:46:08 +0800 Subject: [PATCH] delete avatar when del user --- models/user.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index d5ee5c432eb..a58bb634d9a 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() }