~netlandish/django-wiki

785fb228afedaf3e340ae92f1ce8a855d4d799ad — Christian Duvholt 7 years ago dac520b
Move distinct to can_read
2 files changed, 2 insertions(+), 2 deletions(-)

M wiki/managers.py
M wiki/views/article.py
M wiki/managers.py => wiki/managers.py +1 -1
@@ 43,7 43,7 @@ class ArticleQuerySet(QuerySet):
            q = self.filter(Q(other_read=True) |
                            Q(owner=user) |
                            (Q(group__user=user) & Q(group_read=True))
                            )
                            ).distinct()
        return q

    def can_write(self, user):

M wiki/views/article.py => wiki/views/article.py +1 -1
@@ 595,7 595,7 @@ class SearchView(ListView):
        if not permissions.can_moderate(
                models.URLPath.root().article,
                self.request.user):
            articles = articles.active().can_read(self.request.user).distinct()
            articles = articles.active().can_read(self.request.user)
        return articles

    def get_context_data(self, **kwargs):