Exclude contacted artist links from open link count

This commit is contained in:
byte[] 2023-04-20 14:08:58 -04:00
parent b513e66578
commit 6fa7fb88c5

View file

@ -168,7 +168,7 @@ defmodule Philomena.ArtistLinks do
def count_artist_links(user) do def count_artist_links(user) do
if Canada.Can.can?(user, :index, %ArtistLink{}) do if Canada.Can.can?(user, :index, %ArtistLink{}) do
ArtistLink ArtistLink
|> where([ul], ul.aasm_state in ^["unverified", "link_verified", "contacted"]) |> where([ul], ul.aasm_state in ^["unverified", "link_verified"])
|> Repo.aggregate(:count, :id) |> Repo.aggregate(:count, :id)
else else
nil nil