Skip to content

Commit 429ea84

Browse files
JelteFmhagander
authored andcommitted
Add /current link that links to either /inprogress or /open
1 parent 485caaf commit 429ea84

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pgcommitfest/commitfest/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ def redir(request, what, end):
8686
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_OPEN))
8787
elif what == 'inprogress':
8888
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_INPROGRESS))
89+
elif what == 'current':
90+
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_INPROGRESS))
91+
if len(cfs) == 0:
92+
cfs = list(CommitFest.objects.filter(status=CommitFest.STATUS_OPEN))
8993
else:
9094
raise Http404()
9195

pgcommitfest/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
re_path(r'^$', views.home),
1818
re_path(r'^activity(?P<rss>\.rss)?/', views.activity),
1919
re_path(r'^(\d+)/$', views.commitfest),
20-
re_path(r'^(open|inprogress)/(.*)$', views.redir),
20+
re_path(r'^(open|inprogress|current)/(.*)$', views.redir),
2121
re_path(r'^(?P<cfid>\d+)/activity(?P<rss>\.rss)?/$', views.activity),
2222
re_path(r'^(\d+)/(\d+)/$', views.patch),
2323
re_path(r'^(\d+)/(\d+)/edit/$', views.patchform),

0 commit comments

Comments
 (0)