Merge pull request #632 from AlanCoding/some_test_fixes

do not use expensive visible_roles for Activity Stream filter
This commit is contained in:
Alan Rominger 2017-11-14 09:56:27 -05:00 committed by GitHub
commit 0a883edd4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2243,7 +2243,7 @@ class ActivityStreamAccess(BaseAccess):
Q(notification_template__organization__in=auditing_orgs) |
Q(notification__notification_template__organization__in=auditing_orgs) |
Q(label__organization__in=auditing_orgs) |
Q(role__in=Role.visible_roles(self.user) if auditing_orgs else [])
Q(role__in=Role.objects.filter(ancestors__in=self.user.roles.all()) if auditing_orgs else [])
).distinct()
def can_add(self, data):