Skip to content

Commit 5dc436e

Browse files
committed
dashboard: treat only STATUS_CLOSED as closed
The upcoming Drafts commitfest will break the assumption that lower commitfest IDs are always "in the past".
1 parent f3f9eaf commit 5dc436e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

pgcommitfest/commitfest/views.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def patchlist(request, cf, personalized=False):
350350
EXISTS (
351351
SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(self)s
352352
) AND (
353-
poc.commitfest_id < %(cid)s
353+
cf.status = %(status_closed)s
354354
)
355355
THEN 'Your still open patches in a closed commitfest (you should move or close these)'
356356
WHEN
@@ -376,6 +376,7 @@ def patchlist(request, cf, personalized=False):
376376
cf.name AS cf_name,
377377
cf.status AS cf_status,
378378
"""
379+
whereparams["status_closed"] = CommitFest.STATUS_CLOSED
379380
whereparams["needs_author"] = PatchOnCommitFest.STATUS_AUTHOR
380381
whereparams["needs_committer"] = PatchOnCommitFest.STATUS_COMMITTER
381382
is_committer = bool(Committer.objects.filter(user=request.user, active=True))
@@ -542,7 +543,13 @@ def commitfest(request, cfid):
542543
# Generate patch status summary.
543544
curs = connection.cursor()
544545
curs.execute(
545-
"SELECT ps.status, ps.statusstring, count(*) FROM commitfest_patchoncommitfest poc INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status WHERE commitfest_id=%(id)s GROUP BY ps.status ORDER BY ps.sortkey",
546+
"""SELECT ps.status, ps.statusstring, count(*)
547+
FROM commitfest_patchoncommitfest poc
548+
INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status
549+
INNER JOIN commitfest_commitfest cf ON cf.id=poc.commitfest_id
550+
WHERE commitfest_id=%(id)s
551+
GROUP BY ps.status
552+
ORDER BY ps.sortkey""",
546553
{
547554
"id": cf.id,
548555
},

0 commit comments

Comments
 (0)