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}
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}
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."))
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."))