Skip to content

Commit ff94122

Browse files
committed
activity: use new /patch/ URLs
Simplify the Activity query now that patch links no longer need a commitfest ID.
1 parent ee12867 commit ff94122

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

pgcommitfest/commitfest/feeds.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ def item_description(self, item):
3030
)
3131

3232
def item_link(self, item):
33-
if self.cfid:
34-
return "https://commitfest.postgresql.org/{0}/{1}/".format(
35-
self.cfid, item["patchid"]
36-
)
37-
else:
38-
return "https://commitfest.postgresql.org/{cfid}/{patchid}/".format(**item)
33+
return "https://commitfest.postgresql.org/patch/{0}/".format(item["patchid"])
3934

4035
def item_pubdate(self, item):
4136
return item["date"]

pgcommitfest/commitfest/templates/activity.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<tr>
1717
<td style="white-space: nowrap;">{{a.date}}</td>
1818
<td>{{a.by}}</td>
19-
<td><a href="/{%if commitfest%}{{commitfest.id}}{%else%}{{a.cfid}}{%endif%}/{{a.patchid}}/">{{a.name}}</a></td>
19+
<td><a href="/patch/{{a.patchid}}/">{{a.name}}</a></td>
2020
<td>{{a.what}}</td>
2121
</tr>
2222
{%endfor%}

pgcommitfest/commitfest/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def activity(request, cfid=None, rss=None):
141141
cf = None
142142
where = ""
143143

144-
sql = "SELECT ph.date, auth_user.username AS by, ph.what, p.id AS patchid, p.name, (SELECT max(commitfest_id) FROM commitfest_patchoncommitfest poc WHERE poc.patch_id=p.id) AS cfid FROM commitfest_patchhistory ph INNER JOIN commitfest_patch p ON ph.patch_id=p.id INNER JOIN auth_user on auth_user.id=ph.by_id {0} ORDER BY ph.date DESC LIMIT {1}".format(
144+
sql = "SELECT ph.date, auth_user.username AS by, ph.what, p.id AS patchid, p.name FROM commitfest_patchhistory ph INNER JOIN commitfest_patch p ON ph.patch_id=p.id INNER JOIN auth_user on auth_user.id=ph.by_id {0} ORDER BY ph.date DESC LIMIT {1}".format(
145145
where, num
146146
)
147147

0 commit comments

Comments
 (0)