From 71eb3faebc963be81da9510d0135bfb743ecf1c5 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 1 Mar 2024 17:21:10 +0100 Subject: [PATCH] fix --- crates/api_crud/src/comment/create.rs | 4 +++- crates/apub/src/objects/comment.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/api_crud/src/comment/create.rs b/crates/api_crud/src/comment/create.rs index 8369d1883..e5a869223 100644 --- a/crates/api_crud/src/comment/create.rs +++ b/crates/api_crud/src/comment/create.rs @@ -56,7 +56,9 @@ pub async fn create_comment( check_post_deleted_or_removed(&post)?; // Check if post is locked, no new comments - let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), local_user_view.person, community_id)?; + let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), &local_user_view.person, community_id) + .await + .is_ok(); if post.locked && !is_mod_or_admin { Err(LemmyErrorType::Locked)? } diff --git a/crates/apub/src/objects/comment.rs b/crates/apub/src/objects/comment.rs index f66b6b1f3..6d8d814bf 100644 --- a/crates/apub/src/objects/comment.rs +++ b/crates/apub/src/objects/comment.rs @@ -143,7 +143,9 @@ impl Object for ApubComment { verify_person_in_community(¬e.attributed_to, &community, context).await?; let (post, _) = note.get_parents(context).await?; let creator = note.attributed_to.dereference(context).await?; - let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), creator, community.id)?; + let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), &creator, community.id) + .await + .is_ok(); if post.locked && !is_mod_or_admin { Err(LemmyErrorType::PostIsLocked)? } else {