parent
e8d62e150a
commit
1653a3ac74
@ -59,6 +59,9 @@ fn create(conn: DbConn, data: Form<NewBlogForm>, user: User) -> Redirect {
|
|||||||
let form = data.get();
|
let form = data.get();
|
||||||
let slug = utils::make_actor_id(form.title.to_string());
|
let slug = utils::make_actor_id(form.title.to_string());
|
||||||
|
|
||||||
|
if Blog::find_local(&*conn, slug.clone()).is_some() {
|
||||||
|
Redirect::to(uri!(new))
|
||||||
|
} else {
|
||||||
let blog = Blog::insert(&*conn, NewBlog::new_local(
|
let blog = Blog::insert(&*conn, NewBlog::new_local(
|
||||||
slug.to_string(),
|
slug.to_string(),
|
||||||
form.title.to_string(),
|
form.title.to_string(),
|
||||||
@ -75,6 +78,7 @@ fn create(conn: DbConn, data: Form<NewBlogForm>, user: User) -> Redirect {
|
|||||||
|
|
||||||
Redirect::to(format!("/~/{}/", slug))
|
Redirect::to(format!("/~/{}/", slug))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[get("/~/<name>/outbox")]
|
#[get("/~/<name>/outbox")]
|
||||||
fn outbox(name: String, conn: DbConn) -> ActivityStream<OrderedCollection> {
|
fn outbox(name: String, conn: DbConn) -> ActivityStream<OrderedCollection> {
|
||||||
|
Loading…
Reference in New Issue
Block a user