Skip to content

Commit 238b4fe

Browse files
Aditya-SarnaAditya SarnaJelteF
authored
Filters out 'Moved to other CF' patches from draft commitfest pages (#100)
Reduces clutter on draft commitfest pages by hiding moved patches (including from the status summary at the top of the page). --------- Co-authored-by: Aditya Sarna <adityasarna@Adityas-MacBook-Air.local> Co-authored-by: Jelte Fennema-Nio <postgres@jeltef.nl>
1 parent 55220c0 commit 238b4fe

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pgcommitfest/commitfest/views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ def patchlist(request, cf, personalized=False):
407407
whereclauses.append("poc.status=ANY(%(openstatuses)s)")
408408
else:
409409
whereclauses.append("poc.commitfest_id=%(cid)s")
410+
# Exclude "Moved to other CF" patches from draft commitfests
411+
if cf.draft:
412+
whereclauses.append("poc.status != %(status_moved)s")
413+
whereparams["status_moved"] = PatchOnCommitFest.STATUS_MOVED
410414

411415
if personalized:
412416
# For now we can just order by these names in descending order, because
@@ -616,10 +620,13 @@ def commitfest(request, cfid):
616620
return patch_list.redirect
617621

618622
# Generate patch status summary.
623+
# Exclude "Moved to other CF" status from draft commitfests
624+
status_filter = "AND poc.status != %(status_moved)s" if cf.draft else ""
619625
curs.execute(
620-
"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",
626+
f"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 {status_filter} GROUP BY ps.status ORDER BY ps.sortkey",
621627
{
622628
"id": cf.id,
629+
"status_moved": PatchOnCommitFest.STATUS_MOVED,
623630
},
624631
)
625632
statussummary = curs.fetchall()

0 commit comments

Comments
 (0)