mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 20:31:19 +00:00
Don't let a person block themselves
This commit is contained in:
parent
e6e43cbdea
commit
a22bbcb394
1 changed files with 6 additions and 0 deletions
|
@ -494,6 +494,12 @@ impl Perform for BlockPerson {
|
|||
|
||||
let recipient_id = data.person_id;
|
||||
let person_id = local_user_view.person.id;
|
||||
|
||||
// Don't let a person block themselves
|
||||
if recipient_id == person_id {
|
||||
return Err(ApiError::err("cant_block_yourself").into());
|
||||
}
|
||||
|
||||
let community_block_form = PersonBlockForm {
|
||||
person_id,
|
||||
recipient_id,
|
||||
|
|
Loading…
Reference in a new issue