Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
b6143016
Commit
b6143016
authored
Sep 03, 2018
by
kaniini
Browse files
user: add moderator_user_query()
parent
cf5d1302
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
b6143016
...
...
@@ -609,6 +609,14 @@ def local_user_query() 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
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment