mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 16:40:29 +00:00
user: add moderator_user_query()
This commit is contained in:
parent
cf5d1302aa
commit
b61430163b
1 changed files with 8 additions and 0 deletions
|
@ -609,6 +609,14 @@ defmodule Pleroma.User do
|
||||||
)
|
)
|
||||||
end
|
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
|
def deactivate(%User{} = user) do
|
||||||
new_info = Map.put(user.info, "deactivated", true)
|
new_info = Map.put(user.info, "deactivated", true)
|
||||||
cs = User.info_changeset(user, %{info: new_info})
|
cs = User.info_changeset(user, %{info: new_info})
|
||||||
|
|
Loading…
Reference in a new issue