summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-04-05 13:27:10 -0700
committereliott <eliott@cactuswax.net>2008-04-05 13:27:10 -0700
commit5f48dda94b593feefd906a7aa495427c870d6db9 (patch)
tree4d3fcd300f9e747b77ae41922ec943f1e9939faa /main/models.py
parent1bac739c5cbf13163072d6929c43f686c4a828c9 (diff)
Fix for FS#9554
Backported and modified from 'master'
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/main/models.py b/main/models.py
index 74f2cdbf..525a4ceb 100644
--- a/main/models.py
+++ b/main/models.py
@@ -70,14 +70,22 @@ class PackageManager(models.Manager):
def get_flag_stats(self):
results = []
# first the orphans
- unflagged = self.filter(maintainer=0).count()
- flagged = self.filter(maintainer=0).filter(needupdate=True).count()
- results.append((User(id=0,first_name='Orphans'), unflagged, flagged))
+ noflag = self.filter(maintainer=0).count()
+ flagged = self.filter(maintainer=0).filter(needupdate=True).count()
+ flagnotest = self.filter(maintainer=0).filter(
+ needupdate=True).exclude(
+ repo=Package.REPOS['testing']).count()
+ results.append(
+ (User(id=0,first_name='Orphans'), noflag, flagged, flagnotest))
# now the rest
for maint in User.objects.all().order_by('first_name'):
- unflagged = self.filter(maintainer=maint.id).count()
- flagged = self.filter(maintainer=maint.id).filter(needupdate=True).count()
- results.append((maint, unflagged, flagged))
+ noflag = self.filter(maintainer=maint.id).count()
+ flagged = self.filter(maintainer=maint.id).filter(
+ needupdate=True).count()
+ flagnotest = self.filter(maintainer=maint.id).filter(
+ needupdate=True).exclude(
+ repo=Package.REPOS['testing']).count()
+ results.append((maint, noflag, flagged, flagnotest))
return results