projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d6b9ce
)
Aliases: refactor validate_also_known_as/1
author
Alex Gleason
<alex@alexgleason.me>
Thu, 31 Dec 2020 18:53:28 +0000
(12:53 -0600)
committer
Alex Gleason
<alex@alexgleason.me>
Thu, 31 Dec 2020 18:53:28 +0000
(12:53 -0600)
lib/pleroma/user.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index 7b26ac7a3ebe0917934adf42a5565b55bfc0cb81..2308456628a7007968f08c7f594c72bfdc6fe746 100644
(file)
--- 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