File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,12 @@ def global_search(request):
258258 'title' : 'Patch search results' ,
259259 })
260260
261+ def patch_redirect (request , patchid ):
262+ last_commitfest = PatchOnCommitFest .objects .select_related ('commitfest' ).filter (patch_id = patchid ).order_by ('-commitfest__startdate' ).first ()
263+ if not last_commitfest :
264+ raise Http404 ("Patch not found" )
265+ return HttpResponseRedirect (f'/{ last_commitfest .commitfest_id } /{ patchid } /' )
266+
261267
262268def patch (request , cfid , patchid ):
263269 cf = get_object_or_404 (CommitFest , pk = cfid )
Original file line number Diff line number Diff line change 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 ),
You can’t perform that action at this time.
0 commit comments