Skip to content

Commit 9f0cdd3

Browse files
committed
dashboard: treat only STATUS_CLOSED as closed
The upcoming Parking Lot commitfest will break the assumption that lower commitfest IDs are always "in the past".
1 parent ff94122 commit 9f0cdd3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pgcommitfest/commitfest/views.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def patchlist(request, cf, personalized=False):
323323
EXISTS (
324324
SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(self)s
325325
) AND (
326-
poc.commitfest_id < %(cid)s
326+
cf.status = %(status_closed)s
327327
)
328328
THEN 'Your still open patches in a closed commitfest (you should move or close these)'
329329
WHEN
@@ -349,6 +349,7 @@ def patchlist(request, cf, personalized=False):
349349
cf.name AS cf_name,
350350
cf.status AS cf_status,
351351
"""
352+
whereparams["status_closed"] = CommitFest.STATUS_CLOSED
352353
whereparams["needs_author"] = PatchOnCommitFest.STATUS_AUTHOR
353354
whereparams["needs_committer"] = PatchOnCommitFest.STATUS_COMMITTER
354355
is_committer = bool(Committer.objects.filter(user=request.user, active=True))
@@ -515,7 +516,13 @@ def commitfest(request, cfid):
515516
# Generate patch status summary.
516517
curs = connection.cursor()
517518
curs.execute(
518-
"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",
519+
"""SELECT ps.status, ps.statusstring, count(*)
520+
FROM commitfest_patchoncommitfest poc
521+
INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status
522+
INNER JOIN commitfest_commitfest cf ON cf.id=poc.commitfest_id
523+
WHERE commitfest_id=%(id)s
524+
GROUP BY ps.status
525+
ORDER BY ps.sortkey""",
519526
{
520527
"id": cf.id,
521528
},

0 commit comments

Comments
 (0)