diff options
Diffstat (limited to 'pgcommitfest')
| -rw-r--r-- | pgcommitfest/commitfest/views.py | 10 | ||||
| -rw-r--r-- | pgcommitfest/urls.py | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index fe5b560..b04030b 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -32,6 +32,16 @@ def home(request): 'title': 'Commitfests', }, context_instance=RequestContext(request)) +def redir(request, what): + if what == 'open': + cf = get_object_or_404(CommitFest, status=CommitFest.STATUS_OPEN) + elif what == 'inprogress': + cf = get_object_or_404(CommitFest, status=CommitFest.STATUS_INPROGRESS) + else: + raise Http404() + + return HttpResponseRedirect("/%s/" % cf.id) + def commitfest(request, cfid): # Find ourselves cf = get_object_or_404(CommitFest, pk=cfid) diff --git a/pgcommitfest/urls.py b/pgcommitfest/urls.py index fb32e67..ef1d38c 100644 --- a/pgcommitfest/urls.py +++ b/pgcommitfest/urls.py @@ -8,6 +8,7 @@ admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'commitfest.views.home'), url(r'^(\d+)/$', 'commitfest.views.commitfest'), + url(r'^(open|inprogress)/$', 'commitfest.views.redir'), url(r'^(\d+)/(\d+)/$', 'commitfest.views.patch'), url(r'^(\d+)/(\d+)/edit/$', 'commitfest.views.patchform'), url(r'^(\d+)/new/$', 'commitfest.views.newpatch'), |
