mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 08:54:01 +00:00
This commit is contained in:
parent
ae84258c41
commit
3488b9aeb5
1 changed files with 10 additions and 9 deletions
|
@ -46,15 +46,16 @@ impl PerformCrud for GetPersonDetails {
|
||||||
let person_details_id = match data.person_id {
|
let person_details_id = match data.person_id {
|
||||||
Some(id) => id,
|
Some(id) => id,
|
||||||
None => {
|
None => {
|
||||||
let name = data
|
if let Some(username) = &data.username {
|
||||||
.username
|
resolve_actor_identifier::<ApubPerson, Person>(username, context)
|
||||||
.to_owned()
|
|
||||||
.unwrap_or_else(|| "admin".to_string());
|
|
||||||
|
|
||||||
resolve_actor_identifier::<ApubPerson, Person>(&name, context)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|e| e.with_message("couldnt_find_that_username_or_email"))?
|
.map_err(|e| e.with_message("couldnt_find_that_username_or_email"))?
|
||||||
.id
|
.id
|
||||||
|
} else {
|
||||||
|
return Err(LemmyError::from_message(
|
||||||
|
"couldnt_find_that_username_or_email",
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue