summaryrefslogtreecommitdiffstats
path: root/hyperkitty/views/thread.py
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-02-12 13:29:32 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-02-12 13:29:32 +0100
commitccafc51ade9536046aeb096b04b069f17874fab4 (patch)
treee93564b45884debca14d561552a96a980819943d /hyperkitty/views/thread.py
parent0b0395fe000957b336d0ece6b23af0083a0853ab (diff)
downloadhyperkitty-ccafc51ade9536046aeb096b04b069f17874fab4.tar.gz
hyperkitty-ccafc51ade9536046aeb096b04b069f17874fab4.tar.xz
hyperkitty-ccafc51ade9536046aeb096b04b069f17874fab4.zip
Add a "Create new thread" button
Diffstat (limited to 'hyperkitty/views/thread.py')
-rw-r--r--hyperkitty/views/thread.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py
index c819792..5375bea 100644
--- a/hyperkitty/views/thread.py
+++ b/hyperkitty/views/thread.py
@@ -29,6 +29,7 @@ from django.template import RequestContext, loader
from django.conf import settings
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger, InvalidPage
from django.core.urlresolvers import reverse
+from django.core.exceptions import SuspiciousOperation
from django.utils.datastructures import SortedDict
from django.contrib.auth.decorators import (login_required,
permission_required,
@@ -136,8 +137,7 @@ def add_tag(request, mlist_fqdn, threadid):
content_type="text/plain", status=403)
if request.method != 'POST':
- return HttpResponse("Something went wrong here",
- content_type="text/plain", status=500)
+ raise SuspiciousOperation
form = AddTagForm(request.POST)
if not form.is_valid():
@@ -171,8 +171,7 @@ def favorite(request, mlist_fqdn, threadid):
content_type="text/plain", status=403)
if request.method != 'POST':
- return HttpResponse("Something went wrong here",
- content_type="text/plain", status=500)
+ raise SuspiciousOperation
props = dict(list_address=mlist_fqdn, threadid=threadid, user=request.user)
if request.POST["action"] == "add":
@@ -189,7 +188,6 @@ def favorite(request, mlist_fqdn, threadid):
else:
fav.delete()
else:
- return HttpResponse("Something went wrong here",
- content_type="text/plain", status=500)
+ raise SuspiciousOperation
return HttpResponse("success", mimetype='text/plain')