Add a fqn field to blogs and users (#457)

Fixes #319
This commit is contained in:
Baptiste Gelez
2019-03-06 18:28:10 +01:00
committed by GitHub
parent eff2698664
commit fe6e69d7c4
39 changed files with 258 additions and 141 deletions
+2 -2
View File
@@ -269,7 +269,7 @@ impl Post {
post.ap_url = ap_url(&format!(
"{}/~/{}/{}/",
*BASE_URL,
post.get_blog(conn)?.get_fqn(conn),
post.get_blog(conn)?.fqn,
post.slug
));
let _: Post = post.save_changes(conn)?;
@@ -850,7 +850,7 @@ impl Post {
pub fn url(&self, conn: &Connection) -> Result<String> {
let blog = self.get_blog(conn)?;
Ok(format!("/~/{}/{}", blog.get_fqn(conn), self.slug))
Ok(format!("/~/{}/{}", blog.fqn, self.slug))
}
pub fn cover_url(&self, conn: &Connection) -> Option<String> {