Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f12a5e

Browse files
JelteFmhagander
authored andcommitted
Add a stable URL for a patch that redirects to latest cf
Links to patches get outdated ever time we move it to new commitfest.
1 parent429ea84 commit9f12a5e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

‎pgcommitfest/commitfest/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ def global_search(request):
258258
'title':'Patch search results',
259259
})
260260

261+
defpatch_redirect(request,patchid):
262+
last_commitfest=PatchOnCommitFest.objects.select_related('commitfest').filter(patch_id=patchid).order_by('-commitfest__startdate').first()
263+
ifnotlast_commitfest:
264+
raiseHttp404("Patch not found")
265+
returnHttpResponseRedirect(f'/{last_commitfest.commitfest_id}/{patchid}/')
266+
261267

262268
defpatch(request,cfid,patchid):
263269
cf=get_object_or_404(CommitFest,pk=cfid)

‎pgcommitfest/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
re_path(r'^(\d+)/$',views.commitfest),
2020
re_path(r'^(open|inprogress|current)/(.*)$',views.redir),
2121
re_path(r'^(?P<cfid>\d+)/activity(?P<rss>\.rss)?/$',views.activity),
22+
re_path(r'^patch/(\d+)/$',views.patch_redirect),
2223
re_path(r'^(\d+)/(\d+)/$',views.patch),
2324
re_path(r'^(\d+)/(\d+)/edit/$',views.patchform),
2425
re_path(r'^(\d+)/new/$',views.newpatch),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp