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:
fdb-hiroshima
2019-09-13 11:29:52 +02:00
committed by Igor Galić
parent d4a1bd6de7
commit 12c80f9981
2 changed files with 17 additions and 2 deletions
+5
View File
@@ -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(|_| ())