diff --git a/src/routes/posts.rs b/src/routes/posts.rs index e3bc3426..9fc0ad51 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -401,7 +401,7 @@ pub fn valid_slug(title: &str) -> Result<(), ValidationError> { } #[post("/~//new", data = "
")] -pub fn create( +pub async fn create( blog_name: String, form: LenientForm, cl: ContentLen, diff --git a/src/routes/user.rs b/src/routes/user.rs index eca17a68..1606abb1 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -277,7 +277,10 @@ pub async fn followers( let conn = &*rockets.conn; let page = page.unwrap_or_default(); let user: User = User::find_by_fqn(&rockets, &name).await?; - let followers_count = user.count_followers(&conn); + let followers_count = match user.count_followers(&conn) { + Ok(num) => num, + Err(_) => 0, + }; Ok(render!(users::followers( &rockets.to_context(),