def watch_thread(request, document_slug, thread_id): """Watch/unwatch a thread (based on 'watch' POST param).""" doc = get_document(document_slug, request) thread = get_object_or_404(Thread, pk=thread_id, document=doc) if request.POST.get("watch") == "yes": NewPostEvent.notify(request.user, thread) else: NewPostEvent.stop_notifying(request.user, thread) return HttpResponseRedirect( reverse("wiki.discuss.posts", args=[document_slug, thread_id]))
def watch_thread(request, document_slug, thread_id): """Watch/unwatch a thread (based on 'watch' POST param).""" doc = get_document(document_slug, request) thread = get_object_or_404(Thread, pk=thread_id, document=doc) if request.POST.get("watch") == "yes": NewPostEvent.notify(request.user, thread) statsd.incr("kbforums.watches.thread") else: NewPostEvent.stop_notifying(request.user, thread) return HttpResponseRedirect(reverse("wiki.discuss.posts", args=[document_slug, thread_id]))
def watch_thread(request, document_slug, thread_id): """Watch/unwatch a thread (based on 'watch' POST param).""" doc = get_document(document_slug, request) thread = get_object_or_404(Thread, pk=thread_id, document=doc) if request.POST.get('watch') == 'yes': NewPostEvent.notify(request.user, thread) statsd.incr('kbforums.watches.thread') else: NewPostEvent.stop_notifying(request.user, thread) return HttpResponseRedirect( reverse('wiki.discuss.posts', args=[document_slug, thread_id]))