]> Untitled Git - lemmy.git/blobdiff - crates/api/src/community/ban.rs
Making community_follower.pending column not null.
[lemmy.git] / crates / api / src / community / ban.rs
index ccdc1b9b75fab5bc46799c7a37606393abd9bd38..f4a727ebe446d42e0c30111db90c9d9a4bffc032 100644 (file)
@@ -1,11 +1,8 @@
 use crate::Perform;
 use actix_web::web::Data;
 use lemmy_api_common::{
-  blocking,
   community::{BanFromCommunity, BanFromCommunityResponse},
-  get_local_user_view_from_jwt,
-  is_mod_or_admin,
-  remove_user_data_in_community,
+  utils::{blocking, get_local_user_view_from_jwt, is_mod_or_admin, remove_user_data_in_community},
 };
 use lemmy_apub::{
   activities::block::SiteOrCommunity,
@@ -26,7 +23,7 @@ use lemmy_db_schema::{
   },
   traits::{Bannable, Crud, Followable},
 };
-use lemmy_db_views_actor::person_view::PersonViewSafe;
+use lemmy_db_views_actor::structs::PersonViewSafe;
 use lemmy_utils::{utils::naive_from_unix, ConnectionId, LemmyError};
 use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation};
 
@@ -79,7 +76,7 @@ impl Perform for BanFromCommunity {
       let community_follower_form = CommunityFollowerForm {
         community_id: data.community_id,
         person_id: banned_person_id,
-        pending: false,
+        pending: Some(false),
       };
       blocking(context.pool(), move |conn: &'_ _| {
         CommunityFollower::unfollow(conn, &community_follower_form)