Exemplo n.º 1
0
def patch_is_unapproved(request, thread, value):
    allow_approve_thread(request.user, thread)

    if value:
        raise PermissionDenied(_("Content approval can't be reversed."))

    moderation.approve_thread(request, thread)

    return {
        'is_unapproved': thread.is_unapproved,
        'has_unapproved_posts': thread.has_unapproved_posts,
    }
Exemplo n.º 2
0
def patch_is_unapproved(request, thread, value):
    allow_approve_thread(request.user, thread)

    if value:
        raise PermissionDenied(_("Content approval can't be reversed."))

    moderation.approve_thread(request, thread)

    return {
        'is_unapproved': thread.is_unapproved,
        'has_unapproved_posts': thread.has_unapproved_posts,
    }