mirror of
https://github.com/kanidm/kanidm.git
synced 2025-04-19 08:45:39 +02:00
cargo fmt
This commit is contained in:
parent
a708d8c938
commit
9b3f814b67
|
@ -69,7 +69,7 @@ pub(crate) struct CommitSaveProfileQuery {
|
||||||
#[serde(rename = "emails[]")]
|
#[serde(rename = "emails[]")]
|
||||||
emails: Vec<String>,
|
emails: Vec<String>,
|
||||||
#[serde(rename = "new_primary_mail")]
|
#[serde(rename = "new_primary_mail")]
|
||||||
new_primary_mail: Option<String>
|
new_primary_mail: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
@ -123,7 +123,7 @@ pub(crate) async fn view_profile_get(
|
||||||
&kopid,
|
&kopid,
|
||||||
client_auth_info.clone(),
|
client_auth_info.clone(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let time = time::OffsetDateTime::now_utc() + time::Duration::new(60, 0);
|
let time = time::OffsetDateTime::now_utc() + time::Duration::new(60, 0);
|
||||||
|
|
||||||
|
@ -163,7 +163,8 @@ pub(crate) async fn view_profile_diff_start_save_post(
|
||||||
state,
|
state,
|
||||||
&kopid,
|
&kopid,
|
||||||
client_auth_info.clone(),
|
client_auth_info.clone(),
|
||||||
).await?;
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let primary_index = query
|
let primary_index = query
|
||||||
.emails_indexes
|
.emails_indexes
|
||||||
|
@ -179,11 +180,12 @@ pub(crate) async fn view_profile_diff_start_save_post(
|
||||||
value: email.to_string(),
|
value: email.to_string(),
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let old_primary_mail = scim_person.mails.iter()
|
let old_primary_mail = scim_person
|
||||||
|
.mails
|
||||||
|
.iter()
|
||||||
.find(|sm| sm.primary)
|
.find(|sm| sm.primary)
|
||||||
.map(|sm| sm.value.clone());
|
.map(|sm| sm.value.clone());
|
||||||
|
|
||||||
|
|
||||||
let profile_view = ProfileChangesPartialView {
|
let profile_view = ProfileChangesPartialView {
|
||||||
menu_active_item: ProfileMenuItems::UserProfile,
|
menu_active_item: ProfileMenuItems::UserProfile,
|
||||||
can_rw,
|
can_rw,
|
||||||
|
@ -200,7 +202,8 @@ pub(crate) async fn view_profile_diff_start_save_post(
|
||||||
Ok((
|
Ok((
|
||||||
HxPushUrl(Uri::from_static("/ui/profile/diff")),
|
HxPushUrl(Uri::from_static("/ui/profile/diff")),
|
||||||
profile_view,
|
profile_view,
|
||||||
).into_response())
|
)
|
||||||
|
.into_response())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn view_profile_diff_confirm_save_post(
|
pub(crate) async fn view_profile_diff_confirm_save_post(
|
||||||
|
@ -233,7 +236,6 @@ pub(crate) async fn view_profile_diff_confirm_save_post(
|
||||||
.map_err(|op_err| HtmxError::new(&kopid, op_err, domain_info.clone()))
|
.map_err(|op_err| HtmxError::new(&kopid, op_err, domain_info.clone()))
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
||||||
let mut emails = query.emails;
|
let mut emails = query.emails;
|
||||||
if let Some(primary) = query.new_primary_mail {
|
if let Some(primary) = query.new_primary_mail {
|
||||||
emails.insert(0, primary);
|
emails.insert(0, primary);
|
||||||
|
@ -286,7 +288,7 @@ pub(crate) async fn view_profile_diff_confirm_save_post(
|
||||||
VerifiedClientInformation(client_auth_info),
|
VerifiedClientInformation(client_auth_info),
|
||||||
DomainInfo(domain_info),
|
DomainInfo(domain_info),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(_) => Ok(Redirect::to(Urls::Profile.as_ref()).into_response()),
|
Ok(_) => Ok(Redirect::to(Urls::Profile.as_ref()).into_response()),
|
||||||
Err(e) => Ok(e.into_response()),
|
Err(e) => Ok(e.into_response()),
|
||||||
|
@ -351,5 +353,5 @@ pub(crate) async fn view_profile_unlock_get(
|
||||||
Urls::Profile.as_ref(),
|
Urls::Profile.as_ref(),
|
||||||
display_ctx,
|
display_ctx,
|
||||||
)
|
)
|
||||||
.await)
|
.await)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue