-
Notifications
You must be signed in to change notification settings - Fork 12
enhancement: added commitfest stats to /me page #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
3f1bc1d
c8482b5
bb4e557
ff3fe8a
cdec174
abfff8c
f0f6ebc
75b5fb4
d716195
b4258ef
7f76579
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,14 +86,36 @@ def me(request): | |
if patch_list.redirect: | ||
return patch_list.redirect | ||
|
||
# Get stats related to user for current commitfest | ||
curs = connection.cursor() | ||
curs.execute( | ||
"""SELECT | ||
ps.status, ps.statusstring, count(*) | ||
FROM commitfest_patchoncommitfest poc | ||
INNER JOIN commitfest_patchstatus ps ON ps.status=poc.status | ||
LEFT JOIN commitfest_patch_authors pa ON pa.patch_id=poc.patch_id | ||
LEFT JOIN commitfest_patch_reviewers pr ON pr.patch_id=poc.patch_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will inflate counts if a patch has more than one author or reviewer. Instead of doing this join we should use the same WHERE filter we use for the display list:
|
||
LEFT JOIN commitfest_patch_subscribers psubs ON psubs.patch_id=poc.patch_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd keep out the subscribers for now, I think it's a good addition, but we don't use that in the display query so that's just confusing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, removing this |
||
WHERE commitfest_id=%(id)s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check should be removed, right now we don't filter the list by commitfest_id. So the counts shouldn't be filtered by it either. |
||
AND ( | ||
pa.user_id=%(user_id)s | ||
OR pr.user_id=%(user_id)s | ||
OR psubs.user_id=%(user_id)s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A check for the patch status should be added. Right now it's also showing closed patches, even though we filter these out when displaying the list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a check to eliminate committed, withdrawn and rejected patches. Although wouldn't it be better to also show the withdrawn patches? Just in case if someone wants to revisit the patch in future |
||
) | ||
GROUP BY ps.status ORDER BY ps.sortkey""", | ||
{"id": cf.id, "user_id": request.user.id}, | ||
) | ||
statussummary = curs.fetchall() | ||
print(statussummary) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test print that should go away |
||
|
||
return render( | ||
request, | ||
"me.html", | ||
{ | ||
"form": form, | ||
"title": "Personal Dashboard", | ||
"patches": patch_list.patches, | ||
"statussummary": "", | ||
"statussummary": statussummary, | ||
"has_filter": patch_list.has_filter, | ||
"grouping": patch_list.sortkey == 0, | ||
"sortkey": patch_list.sortkey, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this below the buttons, so it matches the layout of the commitfest page.