fix: correctly load and pass the user when deleting it

Fixes #984
This commit is contained in:
kolaente 2021-10-16 17:00:48 +02:00
parent d7e47a28d4
commit 50b65a517d
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 2 deletions

View File

@ -103,7 +103,7 @@ func getUserFromArg(s *xorm.Session, arg string) *user.User {
log.Fatalf("Invalid user id: %s", err)
}
u, err := user.GetUserByID(s, id)
u, err := user.GetUserWithEmail(s, &user.User{ID: id})
if err != nil {
log.Fatalf("Could not get user: %s", err)
}

View File

@ -167,7 +167,9 @@ func DeleteUser(s *xorm.Session, u *user.User) (err error) {
return err
}
return notifications.Notify(u, &user.AccountDeletedNotification{})
return notifications.Notify(u, &user.AccountDeletedNotification{
User: u,
})
}
func ensureNamespaceAdminUser(s *xorm.Session, n *Namespace) (hadUsers bool, err error) {