forked from mirrors/akkoma
Reuse query from User.restrict_deactivated/1
This commit is contained in:
parent
5e2b491276
commit
b92c004ea8
2 changed files with 2 additions and 4 deletions
|
@ -115,7 +115,7 @@ defmodule Pleroma.User do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp restrict_deactivated(query) do
|
def restrict_deactivated(query) do
|
||||||
from(u in query,
|
from(u in query,
|
||||||
where: not fragment("? \\? 'deactivated' AND ?->'deactivated' @> 'true'", u.info, u.info)
|
where: not fragment("? \\? 'deactivated' AND ?->'deactivated' @> 'true'", u.info, u.info)
|
||||||
)
|
)
|
||||||
|
|
|
@ -119,9 +119,7 @@ defmodule Pleroma.User.Query do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp compose_query({:deactivated, false}, query) do
|
defp compose_query({:deactivated, false}, query) do
|
||||||
from(u in query,
|
User.restrict_deactivated(query)
|
||||||
where: not fragment("? \\? 'deactivated' AND ?->'deactivated' @> 'true'", u.info, u.info)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp compose_query({:deactivated, true}, query) do
|
defp compose_query({:deactivated, true}, query) do
|
||||||
|
|
Loading…
Reference in a new issue