From 4200a063408966b1e14e79b18c96ce59af23ec35 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 31 Dec 2020 12:53:28 -0600 Subject: [PATCH] Aliases: refactor validate_also_known_as/1 --- lib/pleroma/user.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 7b26ac7a3..230845662 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2458,9 +2458,10 @@ defmodule Pleroma.User do defp validate_also_known_as(changeset) do validate_change(changeset, :also_known_as, fn :also_known_as, also_known_as -> - case Enum.all?(also_known_as, fn a -> Regex.match?(@url_regex, a) end) do - true -> [] - false -> [also_known_as: "Invalid ap_id format. Must be a URL."] + if Enum.all?(also_known_as, fn a -> Regex.match?(@url_regex, a) end) do + [] + else + [also_known_as: "Invalid ap_id format. Must be a URL."] end end) end -- 2.45.2