コード例 #1
0
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]))
コード例 #2
0
ファイル: views.py プロジェクト: chupahanks/kitsune
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]))
コード例 #3
0
ファイル: views.py プロジェクト: zctyhj/kitsune
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]))