})
-def redir(request, what):
+def redir(request, what, end):
if what == 'open':
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_OPEN))
elif what == 'inprogress':
messages.warning(request, "More than one {0} commitfest exists, redirecting to startpage instead.".format(what))
return HttpResponseRedirect("/")
- return HttpResponseRedirect("/%s/" % cfs[0].id)
+ query_string = request.GET.urlencode()
+ if query_string:
+ query_string = '?' + query_string
+ return HttpResponseRedirect(f"/{cfs[0].id}/{end}{query_string}")
def commitfest(request, cfid):
re_path(r'^$', views.home),
re_path(r'^activity(?P<rss>\.rss)?/', views.activity),
re_path(r'^(\d+)/$', views.commitfest),
- re_path(r'^(open|inprogress)/$', views.redir),
+ re_path(r'^(open|inprogress)/(.*)$', views.redir),
re_path(r'^(?P<cfid>\d+)/activity(?P<rss>\.rss)?/$', views.activity),
re_path(r'^(\d+)/(\d+)/$', views.patch),
re_path(r'^(\d+)/(\d+)/edit/$', views.patchform),