Skip to content

Commit

Permalink
[#204] Updated support partner list query
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Jun 17, 2014
1 parent ade9b91 commit 289f4b8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions akvo/rsr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,9 @@ def supportpartners(self):
def supportpartners_with_projects(self):
"""return the organisations in the queryset that are support partners with published projects, not
counting archived projects"""
support_partners = self.supportpartners()
for org in support_partners:
if len(org.active_projects()) == 0:
support_partners = support_partners.exclude(pk=org.pk)
return support_partners
return self.filter(partnerships__partner_type=Partnership.SUPPORT_PARTNER,
partnerships__project__publishingstatus__status='published',
partnerships__project__status__in=['A','C','H','L']).distinct()

def ngos(self):
return self.filter(organisation_type__exact=Organisation.ORG_TYPE_NGO)
Expand Down

0 comments on commit 289f4b8

Please sign in to comment.