Fix problem accessibility

This commit is contained in:
cuom1999 2023-09-12 15:14:06 -05:00
parent 7e4784ea0e
commit 9a1381c2dc

View file

@ -403,17 +403,17 @@ class Problem(models.Model, PageVotable, Bookmarkable):
) )
# Authors, curators, and testers should always have access, so OR at the very end. # Authors, curators, and testers should always have access, so OR at the very end.
filter = Exists( q |= Exists(
Problem.authors.through.objects.filter( Problem.authors.through.objects.filter(
problem=OuterRef("pk"), profile=profile problem=OuterRef("pk"), profile=profile
) )
) )
filter |= Exists( q |= Exists(
Problem.curators.through.objects.filter( Problem.curators.through.objects.filter(
problem=OuterRef("pk"), profile=profile problem=OuterRef("pk"), profile=profile
) )
) )
filter |= Exists( q |= Exists(
Problem.testers.through.objects.filter( Problem.testers.through.objects.filter(
problem=OuterRef("pk"), profile=profile problem=OuterRef("pk"), profile=profile
) )