Add more tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
0f90fd5805
commit
eedf551eed
7 changed files with 100 additions and 21 deletions
|
|
@ -1525,9 +1525,9 @@ defmodule Pleroma.User do
|
|||
with max_endorsed_users <- Pleroma.Config.get([:instance, :max_endorsed_users], 0),
|
||||
endorsed_users <-
|
||||
User.endorsed_users_relation(endorser)
|
||||
|> Pleroma.Repo.all() do
|
||||
|> Repo.aggregate(:count, :id) do
|
||||
cond do
|
||||
Enum.count(endorsed_users) >= max_endorsed_users ->
|
||||
endorsed_users >= max_endorsed_users ->
|
||||
{:error, "You have already pinned the maximum number of users"}
|
||||
|
||||
not following?(endorser, target) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue