mirror of
https://github.com/LemmyNet/lemmy
synced 2024-09-20 06:22:08 +00:00
fix
This commit is contained in:
parent
16bd481aa8
commit
71eb3faebc
2 changed files with 6 additions and 2 deletions
|
@ -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)?
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue