mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-21 12:53:11 +01:00
correctly count user links
This commit is contained in:
parent
0d1ae1e436
commit
2c1725f20a
1 changed files with 1 additions and 1 deletions
|
@ -149,7 +149,7 @@ defmodule Philomena.UserLinks do
|
||||||
def count_user_links(user) do
|
def count_user_links(user) do
|
||||||
if Canada.Can.can?(user, :index, UserLink) do
|
if Canada.Can.can?(user, :index, UserLink) do
|
||||||
UserLink
|
UserLink
|
||||||
|> where(aasm_state: "unverified")
|
|> where([ul], ul.aasm_state in ^["unverified", "link_verified", "contacted"])
|
||||||
|> Repo.aggregate(:count, :id)
|
|> Repo.aggregate(:count, :id)
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Reference in a new issue