mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 19:35:02 -02:30
fix team tests
This commit is contained in:
@@ -94,6 +94,11 @@ class Role(CommonModelNameNotUnique):
|
||||
return reverse('api:role_detail', args=(self.pk,))
|
||||
|
||||
def __contains__(self, user):
|
||||
if user.__class__.__name__ == 'Team':
|
||||
team_type = ContentType.objects.get_for_model(user)
|
||||
roles = Role.objects.filter(content_type__pk=team_type.id,
|
||||
object_id=user.id)
|
||||
return self.ancestors.filter(pk__in=roles).exists()
|
||||
return self.ancestors.filter(members=user).exists()
|
||||
|
||||
def rebuild_role_ancestor_list(self):
|
||||
|
||||
Reference in New Issue
Block a user