Пример #1
0
def patch_is_hidden(request, thread, value):
    if value:
        allow_hide_thread(request.user, thread)
        moderation.hide_thread(request, thread)
    else:
        allow_unhide_thread(request.user, thread)
        moderation.unhide_thread(request, thread)

    return {'is_hidden': thread.is_hidden}
Пример #2
0
def patch_is_hidden(request, thread, value):
    if value:
        allow_hide_thread(request.user, thread)
        moderation.hide_thread(request, thread)
    else:
        allow_unhide_thread(request.user, thread)
        moderation.unhide_thread(request, thread)

    return {'is_hidden': thread.is_hidden}
Пример #3
0
def patch_is_hidden(request, thread, value):
    if thread.acl.get('can_hide'):
        if value:
            moderation.hide_thread(request, thread)
        else:
            moderation.unhide_thread(request, thread)

        return {'is_hidden': thread.is_hidden}
    else:
        raise PermissionDenied(_("You don't have permission to hide this thread."))
Пример #4
0
def patch_is_hidden(request, thread, value):
    if thread.acl.get('can_hide'):
        if value:
            moderation.hide_thread(request.user, thread)
        else:
            moderation.unhide_thread(request.user, thread)

        return {'is_hidden': thread.is_hidden}
    else:
        raise PermissionDenied(
            _("You don't have permission to hide this thread."))