From f634c5212b59511109fc25b57d716bdfe56cd495 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 19 Jul 2013 17:13:38 +0200 Subject: Only CF managers (=staff users) can add patches to != open fests --- pgcommitfest/commitfest/views.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pgcommitfest/commitfest/views.py') diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index 1701028..30d8f2f 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -97,6 +97,9 @@ def patchform(request, cfid, patchid): @transaction.commit_on_success def newpatch(request, cfid): cf = get_object_or_404(CommitFest, pk=cfid) + if not cf.status == CommitFest.STATUS_OPEN and not request.user.is_staff: + raise Http404("This commitfest is not open!") + if request.method == 'POST': form = NewPatchForm(data=request.POST) if form.is_valid(): -- cgit v1.2.3