♻️ Exige la petición en las variantes de ErrorPage
Sustituye `Option<HttpRequest>` por `HttpRequest` en todas las variantes. Ningún uso construía un ErrorPage sin petición y, sin ella, la página de error pierde el idioma negociado y el usuario actual.
This commit is contained in:
parent
947aef2f91
commit
a6d15ab211
13 changed files with 59 additions and 62 deletions
|
|
@ -13,7 +13,7 @@ use crate::settings::{self, SettingFieldType, SettingsSchema};
|
|||
fn config_form_page(
|
||||
request: &HttpRequest,
|
||||
) -> Result<(&'static AdminPage, &'static SettingsSchema), ErrorPage> {
|
||||
let not_found = || ErrorPage::NotFound(Some(request.clone()));
|
||||
let not_found = || ErrorPage::NotFound(request.clone());
|
||||
let path = strip_admin_path(request.path()).ok_or_else(not_found)?;
|
||||
let page = AdminRegistry::global().page(path).ok_or_else(not_found)?;
|
||||
let schema = config_forms().get(path).ok_or_else(not_found)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue