summaryrefslogtreecommitdiffstats
path: root/hyperkitty/views
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2012-12-07 12:05:04 +0100
committerAurélien Bompard <aurelien@bompard.org>2012-12-07 12:05:04 +0100
commit1efaf31a907aa42fc0b01029d332f539b2067a75 (patch)
treeb2e9cc01610f75a3dd01fdbaab02879a24821a39 /hyperkitty/views
parente255c7223ffc9f00f3c85bb573381cf20fcd40a6 (diff)
downloadhyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.tar.gz
hyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.tar.xz
hyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.zip
Factorize the add_tag and like JS functions
Diffstat (limited to 'hyperkitty/views')
-rw-r--r--hyperkitty/views/message.py4
-rw-r--r--hyperkitty/views/thread.py4
2 files changed, 5 insertions, 3 deletions
diff --git a/hyperkitty/views/message.py b/hyperkitty/views/message.py
index d6676d8..5ed17c2 100644
--- a/hyperkitty/views/message.py
+++ b/hyperkitty/views/message.py
@@ -116,11 +116,11 @@ def attachment(request, mlist_fqdn, hashid, counter, filename):
return response
-@login_required
def vote(request, mlist_fqdn):
""" Add a rating to a given message identified by messageid. """
if not request.user.is_authenticated():
- return redirect('user_login')
+ return HttpResponse('You must be logged in to vote',
+ content_type="text/plain", status=403)
value = request.POST['vote']
hashid = request.POST['hashid']
diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py
index 4edd7f7..ec5a60f 100644
--- a/hyperkitty/views/thread.py
+++ b/hyperkitty/views/thread.py
@@ -124,9 +124,11 @@ def thread_index(request, mlist_fqdn, threadid):
return HttpResponse(t.render(c))
-@login_required
def add_tag(request, mlist_fqdn, email_id):
""" Add a tag to a given thread. """
+ if not request.user.is_authenticated():
+ return HttpResponse('You must be logged in to add a tag',
+ content_type="text/plain", status=403)
if request.method == 'POST':
form = AddTagForm(request.POST)