Don't show the "Registrations closed" message if there is an error when creating a new user

This commit is contained in:
Bat 2018-09-07 20:13:14 +01:00
parent ae8f8a1411
commit 2822f8efe9

View file

@ -257,6 +257,7 @@ fn create(conn: DbConn, data: LenientForm<NewUserForm>) -> Result<Redirect, Temp
Redirect::to(uri!(super::session::new))
})
.map_err(|e| Template::render("users/new", json!({
"enabled": Instance::get_local(&*conn).map(|i| i.open_registrations).unwrap_or(true),
"errors": e.inner(),
"form": form
})))