summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-09 02:34:37 +0200
committerDan McGee <dan@archlinux.org>2012-08-09 02:34:37 +0200
commit978a5c61a5412eeed054307d3e2979324ffcb64a (patch)
tree034e2e9a158a4c27741a79ff6028d4cd9c8575e4 /devel
parent064a1b7699ef8f65ee1c123f93cd8da02e843dea (diff)
downloadarchweb-978a5c61a5412eeed054307d3e2979324ffcb64a.tar.gz
archweb-978a5c61a5412eeed054307d3e2979324ffcb64a.tar.xz
Add flag requests to developer last action calculation
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/views.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/devel/views.py b/devel/views.py
index f877bc8..ad1f4de 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -29,7 +29,7 @@ from .models import UserProfile
from main.models import Package, PackageFile, TodolistPkg
from main.models import Arch, Repo
from news.models import News
-from packages.models import PackageRelation, Signoff, Depend
+from packages.models import PackageRelation, Signoff, FlagRequest, Depend
from packages.utils import get_signoff_groups
from todolists.utils import get_annotated_todolists
from .utils import get_annotated_maintainers, UserFinder
@@ -103,6 +103,11 @@ def clock(request):
latest_signoff = dict(Signoff.objects.filter(
user__is_active=True).values_list('user').order_by(
).annotate(last_signoff=Max('created')))
+ # The extra() bit ensures we can use our 'user_id IS NOT NULL' index
+ latest_flagreq = dict(FlagRequest.objects.filter(
+ user__is_active=True).extra(
+ where=['user_id IS NOT NULL']).values_list('user_id').order_by(
+ ).annotate(last_flagrequest=Max('created')))
latest_log = dict(LogEntry.objects.filter(
user__is_active=True).values_list('user').order_by(
).annotate(last_log=Max('action_time')))
@@ -112,6 +117,7 @@ def clock(request):
latest_news.get(dev.id, None),
latest_package.get(dev.id, None),
latest_signoff.get(dev.id, None),
+ latest_flagreq.get(dev.id, None),
latest_log.get(dev.id, None),
dev.last_login,
]