projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf5d130
)
user: add moderator_user_query()
author
William Pitcock
<nenolod@dereferenced.org>
Mon, 3 Sep 2018 12:03:23 +0000
(12:03 +0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Mon, 3 Sep 2018 12:03:23 +0000
(12:03 +0000)
lib/pleroma/user.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index 64c69b209cddc9ae339f4e1a13b2aad6d6361d87..1dad30e876f6265d5835e7604ded15aea50ca3a8 100644
(file)
--- 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})