delete notification on user deletion (#658)
* delete notification on user deletion fix #651 * use the correct id for deletion * add regression test * push helpers too * revert CI changes
This commit is contained in:
committed by
Igor Galić
parent
d4a1bd6de7
commit
12c80f9981
@@ -42,6 +42,7 @@ use db_conn::DbConn;
|
||||
use follows::Follow;
|
||||
use instance::*;
|
||||
use medias::Media;
|
||||
use notifications::Notification;
|
||||
use post_authors::PostAuthor;
|
||||
use posts::Post;
|
||||
use safe_string::SafeString;
|
||||
@@ -147,6 +148,10 @@ impl User {
|
||||
}
|
||||
}
|
||||
|
||||
for notif in Notification::find_followed_by(conn, self)? {
|
||||
notif.delete(conn)?
|
||||
}
|
||||
|
||||
diesel::delete(self)
|
||||
.execute(conn)
|
||||
.map(|_| ())
|
||||
|
||||
Reference in New Issue
Block a user