Fix follow IDs (#455)

* Generate valid IDs for Follow

Fixes #449

* Use the new post-insert hook for all the models

* Fix plume-cli build
This commit is contained in:
Baptiste Gelez
2019-03-04 21:35:03 +01:00
committed by GitHub
parent 9b48b8a846
commit 2a188abfa1
12 changed files with 162 additions and 181 deletions
+1 -2
View File
@@ -227,7 +227,6 @@ pub fn update(blog: String, slug: String, user: User, cl: ContentLen, form: Leni
post.license = form.license.clone();
post.cover_id = form.cover;
post.update(&*conn, &searcher).expect("post::update: update error");;
let post = post.update_ap_url(&*conn).expect("post::update: update ap url error");
if post.published {
post.update_mentions(&conn, mentions.into_iter().filter_map(|m| Mention::build_activity(&conn, &m).ok()).collect())
@@ -338,7 +337,7 @@ pub fn create(blog_name: String, form: LenientForm<NewPostForm>, user: User, cl:
},
&searcher,
).expect("post::create: post save error");
let post = post.update_ap_url(&*conn).expect("post::create: update ap url error");
PostAuthor::insert(&*conn, NewPostAuthor {
post_id: post.id,
author_id: user.id