@@ -64,7 +64,7 @@ def home(request):
64
64
patch_list = patchlist (request , cf )
65
65
66
66
if patch_list .redirect :
67
- return HttpResponseRedirect ( "/" )
67
+ return patch_list . redirect
68
68
69
69
return render (
70
70
request ,
@@ -222,8 +222,13 @@ def patchlist(request, cf, personalized=False):
222
222
elif request .GET ["author" ] == "-3" :
223
223
# Checking for "yourself" requires the user to be logged in!
224
224
if not request .user .is_authenticated :
225
- return HttpResponseRedirect (
226
- "%s?next=%s" % (settings .LOGIN_URL , request .path )
225
+ return PatchList (
226
+ patches = [],
227
+ has_filter = False ,
228
+ sortkey = 0 ,
229
+ redirect = HttpResponseRedirect (
230
+ "%s?next=%s" % (settings .LOGIN_URL , request .path )
231
+ ),
227
232
)
228
233
whereclauses .append (
229
234
"EXISTS (SELECT 1 FROM commitfest_patch_authors cpa WHERE cpa.patch_id=p.id AND cpa.user_id=%(self)s)"
@@ -247,8 +252,13 @@ def patchlist(request, cf, personalized=False):
247
252
elif request .GET ["reviewer" ] == "-3" :
248
253
# Checking for "yourself" requires the user to be logged in!
249
254
if not request .user .is_authenticated :
250
- return HttpResponseRedirect (
251
- "%s?next=%s" % (settings .LOGIN_URL , request .path )
255
+ return PatchList (
256
+ patches = [],
257
+ has_filter = False ,
258
+ sortkey = 0 ,
259
+ redirect = HttpResponseRedirect (
260
+ "%s?next=%s" % (settings .LOGIN_URL , request .path )
261
+ ),
252
262
)
253
263
whereclauses .append (
254
264
"EXISTS (SELECT 1 FROM commitfest_patch_reviewers cpr WHERE cpr.patch_id=p.id AND cpr.user_id=%(self)s)"
@@ -401,7 +411,12 @@ def patchlist(request, cf, personalized=False):
401
411
402
412
if not has_filter and sortkey == 0 and request .GET :
403
413
# Redirect to get rid of the ugly url
404
- return PatchList (patches = [], has_filter = False , sortkey = 0 , redirect = True )
414
+ return PatchList (
415
+ patches = [],
416
+ has_filter = False ,
417
+ sortkey = 0 ,
418
+ redirect = HttpResponseRedirect (request .path ),
419
+ )
405
420
406
421
if whereclauses :
407
422
where_str = "({0})" .format (") AND (" .join (whereclauses ))
@@ -474,7 +489,7 @@ def commitfest(request, cfid):
474
489
475
490
patch_list = patchlist (request , cf )
476
491
if patch_list .redirect :
477
- return HttpResponseRedirect ( f"/ { cf . id } /" )
492
+ return patch_list . redirect
478
493
479
494
# Generate patch status summary.
480
495
curs = connection .cursor ()
0 commit comments