Commit 0483b2c5 authored by Claude Paroz's avatar Claude Paroz

Fix the team roles query

parent 57c46f89
......@@ -135,9 +135,11 @@ class Team(models.Model):
try:
return self.roles[role]
except KeyError:
members = Person.objects.filter(role__team__id=self.id, role__role=role)
if only_active:
members = members.filter(role__is_active=True)
members = Person.objects.filter(role__team__id=self.id,
role__role=role, role__is_active=True)
else:
members = Person.objects.filter(role__team__id=self.id, role__role=role)
return list(members)
def get_coordinators(self):
......@@ -159,9 +161,11 @@ class Team(models.Model):
for role in roles:
members += self.roles[role]
except KeyError:
members = Person.objects.filter(role__team__id=self.id, role__role__in=roles)
if only_active:
members = members.filter(role__is_active=True)
members = Person.objects.filter(role__team__id=self.id,
role__role__in=roles, role__is_active=True)
else:
members = Person.objects.filter(role__team__id=self.id, role__role__in=roles)
return list(members)
def get_committers(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment