This commit is contained in:
Felix Ableitner 2024-05-08 12:46:15 +02:00
parent fb1fc7cb3a
commit 23e51f58ae

View file

@ -3,10 +3,11 @@ use crate::objects::{
community::ApubCommunity, community::ApubCommunity,
person::ApubPerson, person::ApubPerson,
post::ApubPost, post::ApubPost,
};use itertools::Itertools; };
use activitypub_federation::{config::Data, fetch::object_id::ObjectId, traits::Object}; use activitypub_federation::{config::Data, fetch::object_id::ObjectId, traits::Object};
use actix_web::web::Json; use actix_web::web::Json;
use futures::{future::try_join_all, StreamExt}; use futures::{future::try_join_all, StreamExt};
use itertools::Itertools;
use lemmy_api_common::{context::LemmyContext, SuccessResponse}; use lemmy_api_common::{context::LemmyContext, SuccessResponse};
use lemmy_db_schema::{ use lemmy_db_schema::{
newtypes::DbUrl, newtypes::DbUrl,
@ -245,11 +246,11 @@ pub async fn import_settings(
|(blocked, context)| async move { |(blocked, context)| async move {
let context = context.reset_request_count(); let context = context.reset_request_count();
let target = blocked.dereference(&context).await?; let target = blocked.dereference(&context).await?;
let form = PersonBlockForm { let form = PersonBlockForm {
person_id, person_id,
target_id: target.id, target_id: target.id,
}; };
PersonBlock::block(&mut context.pool(), &form).await?; PersonBlock::block(&mut context.pool(), &form).await?;
LemmyResult::Ok(()) LemmyResult::Ok(())
}, },
) )
@ -325,7 +326,7 @@ mod tests {
traits::{Crud, Followable}, traits::{Crud, Followable},
}; };
use lemmy_db_views::structs::LocalUserView; use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::{CommunityFollowerView}; use lemmy_db_views_actor::structs::CommunityFollowerView;
use lemmy_utils::error::{LemmyErrorType, LemmyResult}; use lemmy_utils::error::{LemmyErrorType, LemmyResult};
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
use serial_test::serial; use serial_test::serial;