Role's get_users, get_groups don't return all users/groups

Issue #10 open
Jakub Wiśniowski
created an issue

There is a problem with both get_users and get_groups method in Role that causes that not all users/groups are returned.

IMHO the problem is caused by a bug in Django orm:

however I suggest changing code of the mentioned methods to use:



if content: ctype = ContentType.objects.get_for_model(content) prrs = PrincipalRoleRelation.objects.filter( Q(content_idisnull=True)|Q(, Q(content_typeisnull=True)|Q(content_type=ctype), role=self).exclude(user=None) }}}

instead of:



if content: ctype = ContentType.objects.get_for_model(content) prrs = PrincipalRoleRelation.objects.filter(role=self, content_idin = (None,, content_typein = (None, ctype)).exclude(user=None)


Comments (2)

  1. Jakub Wiśniowski reporter

    Yes it's still true. I have just tried upgrading my project to Django 1.3 and latest django-permissions (instead of my own modifed version) and my tests failed because of this issue.

  2. Log in to comment