mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 00:43:59 +00:00
* Add person name to PersonIsBannedFromSite error (#3786) * Log PersonId instead of Person name (#3850) * Log actor_id for PersonIsBannedFromSite (#3850) --------- Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
This commit is contained in:
parent
c8063f3267
commit
ee7b35a04a
3 changed files with 7 additions and 3 deletions
|
@ -97,7 +97,9 @@ pub(crate) async fn verify_person_in_community(
|
||||||
) -> Result<(), LemmyError> {
|
) -> Result<(), LemmyError> {
|
||||||
let person = person_id.dereference(context).await?;
|
let person = person_id.dereference(context).await?;
|
||||||
if person.banned {
|
if person.banned {
|
||||||
return Err(LemmyErrorType::PersonIsBannedFromSite)?;
|
return Err(LemmyErrorType::PersonIsBannedFromSite(
|
||||||
|
person.actor_id.to_string(),
|
||||||
|
))?;
|
||||||
}
|
}
|
||||||
let person_id = person.id;
|
let person_id = person.id;
|
||||||
let community_id = community.id;
|
let community_id = community.id;
|
||||||
|
|
|
@ -107,7 +107,9 @@ impl Object for ApubPrivateMessage {
|
||||||
check_apub_id_valid_with_strictness(note.id.inner(), false, context).await?;
|
check_apub_id_valid_with_strictness(note.id.inner(), false, context).await?;
|
||||||
let person = note.attributed_to.dereference(context).await?;
|
let person = note.attributed_to.dereference(context).await?;
|
||||||
if person.banned {
|
if person.banned {
|
||||||
return Err(LemmyErrorType::PersonIsBannedFromSite)?;
|
return Err(LemmyErrorType::PersonIsBannedFromSite(
|
||||||
|
person.actor_id.to_string(),
|
||||||
|
))?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ pub enum LemmyErrorType {
|
||||||
InvalidQuery,
|
InvalidQuery,
|
||||||
ObjectNotLocal,
|
ObjectNotLocal,
|
||||||
PostIsLocked,
|
PostIsLocked,
|
||||||
PersonIsBannedFromSite,
|
PersonIsBannedFromSite(String),
|
||||||
InvalidVoteValue,
|
InvalidVoteValue,
|
||||||
PageDoesNotSpecifyCreator,
|
PageDoesNotSpecifyCreator,
|
||||||
PageDoesNotSpecifyGroup,
|
PageDoesNotSpecifyGroup,
|
||||||
|
|
Loading…
Reference in a new issue