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