File tree 2 files changed +7
-0
lines changed
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):
258
258
'title' : 'Patch search results' ,
259
259
})
260
260
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
+
261
267
262
268
def patch (request , cfid , patchid ):
263
269
cf = get_object_or_404 (CommitFest , pk = cfid )
Original file line number Diff line number Diff line change 19
19
re_path (r'^(\d+)/$' , views .commitfest ),
20
20
re_path (r'^(open|inprogress|current)/(.*)$' , views .redir ),
21
21
re_path (r'^(?P<cfid>\d+)/activity(?P<rss>\.rss)?/$' , views .activity ),
22
+ re_path (r'^patch/(\d+)/$' , views .patch_redirect ),
22
23
re_path (r'^(\d+)/(\d+)/$' , views .patch ),
23
24
re_path (r'^(\d+)/(\d+)/edit/$' , views .patchform ),
24
25
re_path (r'^(\d+)/new/$' , views .newpatch ),
You can’t perform that action at this time.
0 commit comments