Revert "CommunityPersonBanAdditionalInfo (partial)"

This reverts commit 158f7f0cd9.
This commit is contained in:
dull b 2023-07-29 01:55:53 +00:00
parent 158f7f0cd9
commit 79a6bf003e
8 changed files with 12 additions and 35 deletions

View file

@ -11,7 +11,6 @@ use crate::{
CommunityModerator,
CommunityModeratorForm,
CommunityPersonBan,
CommunityPersonBanAdditionalInfo,
CommunityPersonBanForm,
CommunityUpdateForm,
},
@ -215,18 +214,6 @@ impl Bannable for CommunityPersonBan {
}
}
impl CommunityPersonBanAdditionalInfo {
pub fn into_full(self, community_id: CommunityId, person_id: PersonId) -> CommunityPersonBan {
CommunityPersonBan {
id: self.id,
published: self.published,
expires: self.expires,
community_id,
person_id,
}
}
}
impl CommunityFollower {
pub fn to_subscribed_type(follower: &Option<Self>) -> SubscribedType {
match follower {

View file

@ -162,16 +162,6 @@ pub struct CommunityPersonBan {
pub expires: Option<chrono::NaiveDateTime>,
}
#[derive(PartialEq, Eq, Debug)]
#[cfg_attr(feature = "full", derive(Queryable, Selectable))]
#[cfg_attr(feature = "full", diesel(table_name = community_person_ban))]
/// Like `CommunityPersonBan` but without `community_id` and `person_id`, which are usually already known
pub struct CommunityPersonBanAdditionalInfo {
pub id: i32,
pub published: chrono::NaiveDateTime,
pub expires: Option<chrono::NaiveDateTime>,
}
#[derive(Clone)]
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
#[cfg_attr(feature = "full", diesel(table_name = community_person_ban))]

View file

@ -72,7 +72,7 @@ fn queries<'a>() -> Queries<
person::all_columns,
aliases::person1.fields(person::all_columns),
CommentAggregatesNotInComment::as_select(),
CommunityPersonBanAdditionalInfo::as_select().nullable(),
community_person_ban::all_columns.nullable(),
comment_like::score.nullable(),
aliases::person2.fields(person::all_columns).nullable(),
);
@ -229,7 +229,7 @@ impl JoinView for CommentReportView {
Person,
Person,
CommentAggregatesNotInComment,
Option<CommunityPersonBanAdditionalInfo>,
Option<CommunityPersonBan>,
Option<i16>,
Option<Person>,
);

View file

@ -48,7 +48,7 @@ type CommentViewTuple = (
Post,
Community,
CommentAggregatesNotInComment,
Option<CommunityPersonBanAdditionalInfo>,
Option<CommunityPersonBan>,
Option<CommunityFollower>,
Option<CommentSaved>,
Option<PersonBlock>,
@ -110,7 +110,7 @@ fn queries<'a>() -> Queries<
post::all_columns,
community::all_columns,
CommentAggregatesNotInComment::as_select(),
CommunityPersonBanAdditionalInfo::as_select().nullable(),
community_person_ban::all_columns.nullable(),
community_follower::all_columns.nullable(),
comment_saved::all_columns.nullable(),
person_block::all_columns.nullable(),

View file

@ -40,7 +40,7 @@ type PostReportViewTuple = (
Community,
Person,
Person,
Option<CommunityPersonBanAdditionalInfo>,
Option<CommunityPersonBan>,
Option<i16>,
PostAggregatesNotInPost,
Option<Person>,
@ -81,7 +81,7 @@ fn queries<'a>() -> Queries<
community::all_columns,
person::all_columns,
aliases::person1.fields(person::all_columns),
CommunityPersonBanAdditionalInfo::as_select().nullable(),
community_person_ban::all_columns.nullable(),
post_like::score.nullable(),
PostAggregatesNotInPost::as_select(),
aliases::person2.fields(person::all_columns.nullable()),

View file

@ -51,7 +51,7 @@ type PostViewTuple = (
Post,
Person,
Community,
Option<CommunityPersonBanAdditionalInfo>,
Option<CommunityPersonBan>,
PostAggregatesNotInPost,
Option<CommunityFollower>,
Option<PostSaved>,
@ -137,7 +137,7 @@ fn queries<'a>() -> Queries<
post::all_columns,
person::all_columns,
community::all_columns,
CommunityPersonBanAdditionalInfo::as_select().nullable(),
community_person_ban::all_columns.nullable(),
PostAggregatesNotInPost::as_select(),
community_follower::all_columns.nullable(),
post_saved::all_columns.nullable(),

View file

@ -48,7 +48,7 @@ type CommentReplyViewTuple = (
Community,
Person,
CommentAggregatesNotInComment,
Option<CommunityPersonBanAdditionalInfo>,
Option<CommunityPersonBan>,
Option<CommunityFollower>,
Option<CommentSaved>,
Option<PersonBlock>,
@ -113,7 +113,7 @@ fn queries<'a>() -> Queries<
community::all_columns,
aliases::person1.fields(person::all_columns),
CommentAggregatesNotInComment::as_select(),
CommunityPersonBanAdditionalInfo::as_select().nullable(),
community_person_ban::all_columns.nullable(),
community_follower::all_columns.nullable(),
comment_saved::all_columns.nullable(),
person_block::all_columns.nullable(),

View file

@ -49,7 +49,7 @@ type PersonMentionViewTuple = (
Community,
Person,
CommentAggregatesNotInComment,
Option<CommunityPersonBanAdditionalInfo>,
Option<CommunityPersonBan>,
Option<CommunityFollower>,
Option<CommentSaved>,
Option<PersonBlock>,
@ -109,7 +109,7 @@ fn queries<'a>() -> Queries<
community::all_columns,
aliases::person1.fields(person::all_columns),
CommentAggregatesNotInComment::as_select(),
CommunityPersonBanAdditionalInfo::as_select().nullable(),
community_person_ban::all_columns.nullable(),
community_follower::all_columns.nullable(),
comment_saved::all_columns.nullable(),
person_block::all_columns.nullable(),