• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

liqd / adhocracy-plus / 18908688697

29 Oct 2025 12:59PM UTC coverage: 44.622% (-44.5%) from 89.135%
18908688697

Pull #2986

github

web-flow
Merge 1dfde8ee7 into 445e1d498
Pull Request #2986: Draft: Speed up Github Ci Tests

3012 of 6750 relevant lines covered (44.62%)

0.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.5
/apps/projects/query.py
1
from django.db.models import Q
1✔
2

3
from adhocracy4.projects.enums import Access
1✔
4

5

6
def filter_viewable(queryset, user):
1✔
7
    # FIXME: has to be in sync with a4projects.view_project  and should
8
    #        be implemented on the Project's QueryManager/QuerySet.
9
    #        Unfortunately that is not possible, as the QueryManager may not
10
    #        be overwritten and the Project model is not swappable.
11
    if user.is_superuser:
×
12
        return queryset
×
13
    elif user.is_authenticated:
×
14
        return queryset.filter(
×
15
            Q(access=Access.PUBLIC)
16
            | Q(access=Access.SEMIPUBLIC)
17
            | Q(participants__in=[user.id])
18
            | Q(organisation__initiators__id__in=[user.id])
19
            | Q(moderators__in=[user.id])
20
            | Q(organisation__member__member__id=user.id)
21
        ).distinct()
22
    else:
23
        return queryset.filter(Q(access=Access.PUBLIC) | Q(access=Access.SEMIPUBLIC))
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc