mirror of
https://github.com/ae-utbm/sith.git
synced 2026-09-09 22:09:14 +00:00
Alternative queryset
This commit is contained in:
+6
-4
@@ -164,11 +164,13 @@ class UECommentQuerySet(models.QuerySet):
|
|||||||
Q(reports=None)
|
Q(reports=None)
|
||||||
| Q(author=user)
|
| Q(author=user)
|
||||||
| Q(
|
| Q(
|
||||||
reports__in=UECommentReport.objects.filter(
|
Exists(
|
||||||
comment=OuterRef("pk"), reporter__in=[user]
|
UECommentReport.objects.filter(
|
||||||
).all()
|
comment=OuterRef("pk"), reporter=user
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
).distinct()
|
|
||||||
return self.filter(author=user)
|
return self.filter(author=user)
|
||||||
|
|
||||||
def annotate_is_reported(self) -> Self:
|
def annotate_is_reported(self) -> Self:
|
||||||
|
|||||||
Reference in New Issue
Block a user