Forbid creating usernames with uppercase characters

We don't actually enforce anything on the ActivityPub level, only
user-facing interfaces

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-17 19:14:55 +01:00
parent c28dae45bb
commit e6077d0dc3
55 changed files with 6436 additions and 4808 deletions

View File

@@ -123,6 +123,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Group do
) do
with creator_actor_id <- Map.get(args, :creator_actor_id),
{:is_owned, %Actor{} = creator_actor} <- User.owns_actor(user, creator_actor_id),
args <- Map.update(args, :preferred_username, "", &String.downcase/1),
args <- Map.put(args, :creator_actor, creator_actor),
args <- save_attached_pictures(args),
{:ok, _activity, %Actor{type: :Group} = group} <-