]> Untitled Git - lemmy.git/blobdiff - crates/db_views/src/post_report_view.rs
Addressing slow profile queries. #2777 (#2830)
[lemmy.git] / crates / db_views / src / post_report_view.rs
index afda89e69f25f71411a65cbd0862c455bc73c090..29136a351b1147fb005c63a3a0d39baab9b2eaf2 100644 (file)
@@ -1,6 +1,5 @@
 use crate::structs::PostReportView;
 use diesel::{
-  dsl::now,
   result::Error,
   BoolExpressionMethods,
   ExpressionMethods,
@@ -77,12 +76,7 @@ impl PostReportView {
         community_person_ban::table.on(
           post::community_id
             .eq(community_person_ban::community_id)
-            .and(community_person_ban::person_id.eq(post::creator_id))
-            .and(
-              community_person_ban::expires
-                .is_null()
-                .or(community_person_ban::expires.gt(now)),
-            ),
+            .and(community_person_ban::person_id.eq(post::creator_id)),
         ),
       )
       .left_join(
@@ -194,12 +188,7 @@ impl<'a> PostReportQuery<'a> {
         community_person_ban::table.on(
           post::community_id
             .eq(community_person_ban::community_id)
-            .and(community_person_ban::person_id.eq(post::creator_id))
-            .and(
-              community_person_ban::expires
-                .is_null()
-                .or(community_person_ban::expires.gt(now)),
-            ),
+            .and(community_person_ban::person_id.eq(post::creator_id)),
         ),
       )
       .left_join(