summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest/views.py
diff options
context:
space:
mode:
authorMagnus Hagander2013-07-19 15:13:38 +0000
committerMagnus Hagander2013-07-19 15:13:38 +0000
commitf634c5212b59511109fc25b57d716bdfe56cd495 (patch)
treeea227fdd10666c45a8f58cd0036ab16e880aa0f9 /pgcommitfest/commitfest/views.py
parente70b670283d3b768b5f73fcef46e7549c59d84b7 (diff)
Only CF managers (=staff users) can add patches to != open fests
Diffstat (limited to 'pgcommitfest/commitfest/views.py')
-rw-r--r--pgcommitfest/commitfest/views.py3
1 files changed, 3 insertions, 0 deletions
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():