Skip to content

Commit c8482b5

Browse files
committed
fixed query to include patches where user is either a reviewer or has subscribed to
1 parent 3f1bc1d commit c8482b5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pgcommitfest/commitfest/views.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,20 @@ def me(request):
8989
# Get stats related to user for current commitfest
9090
curs = connection.cursor()
9191
curs.execute(
92-
"SELECT ps.status, ps.statusstring, count(*) FROM commitfest_patchoncommitfest poc INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status INNER JOIN commitfest_patch_authors pa ON pa.patch_id=poc.patch_id WHERE commitfest_id=%(id)s AND pa.user_id=%(user_id)s GROUP BY ps.status ORDER BY ps.sortkey",
92+
'''SELECT
93+
ps.status, ps.statusstring, count(*)
94+
FROM commitfest_patchoncommitfest poc
95+
INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status
96+
LEFT JOIN commitfest_patch_authors pa ON pa.patch_id=poc.patch_id
97+
LEFT JOIN commitfest_patch_reviewers pr ON pr.patch_id=poc.patch_id
98+
LEFT JOIN commitfest_patch_subscribers psubs ON psubs.patch_id=poc.patch_id
99+
WHERE commitfest_id=%(id)s
100+
AND (
101+
pa.user_id=%(user_id)s
102+
OR pr.user_id=%(user_id)s
103+
OR psubs.user_id=%(user_id)s
104+
)
105+
GROUP BY ps.status ORDER BY ps.sortkey''',
93106
{
94107
"id": cf.id,
95108
"user_id": request.user.id

0 commit comments

Comments
 (0)