def patch_is_unapproved(request, post, value):
    allow_approve_post(request.user, post)

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

    moderation.approve_post(request.user, post)

    return {'is_unapproved': post.is_unapproved}
Example #2
0
def patch_is_unapproved(request, post, value):
    if value is False:
        allow_approve_post(request.user, post)
        moderation.approve_post(request.user, post)
    return {'is_unapproved': post.is_unapproved}