Apply suggestions to 2 files.

This commit is contained in:
Phantasm 2025-06-01 21:25:38 +00:00
commit 9710063fdc
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8
2 changed files with 8 additions and 11 deletions

View file

@ -93,16 +93,8 @@ defmodule Pleroma.Application do
# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
# due to protocol consolidation warnings
# :warnings_as_errors is deprecated via Code.compiler_options/2 since 1.18
if elixir_version = System.version() do
[major, minor] =
elixir_version
|> String.split(".")
|> Enum.map(&String.to_integer/1)
|> Enum.take(2)
if major == 1 and minor < 18 do
Code.compiler_options(warnings_as_errors: false)
end
if Version.compare(System.version(), "1.18.0") == :lt do
Code.compiler_options(warnings_as_errors: false)
end
# Define workers and child supervisors to be supervised

View file

@ -50,7 +50,12 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do
end
def changeset(struct, %{"type" => "Hashtag", "name" => name} = data) do
name = String.downcase(name)
name =
case name do
"#" <> name -> name
name -> name
end
data = Map.put(data, "name", name)