From: William Pitcock Date: Mon, 3 Sep 2018 12:03:23 +0000 (+0000) Subject: user: add moderator_user_query() X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b61430163ba983f1d8a1d762f4eec743ed7ffab1;p=akkoma user: add moderator_user_query() --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 64c69b209..1dad30e87 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -609,6 +609,14 @@ defmodule Pleroma.User do ) end + def moderator_user_query() do + from( + u in User, + where: u.local == true, + where: fragment("?->'is_moderator' @> 'true'", u.info) + ) + end + def deactivate(%User{} = user) do new_info = Map.put(user.info, "deactivated", true) cs = User.info_changeset(user, %{info: new_info})