View Source mix mobilizon.actors.utils (Mobilizon v4.1.0-alpha.1)

Tools for generating usernames from display names

Summary

Functions

Removes all spaces, accents, special characters and diacritics from a string to create a plain ascii username (a-z0-9_)

Functions

Link to this function

create_group(actor, username, name)

View Source
@spec create_group(Mobilizon.Actors.Actor.t(), String.t(), String.t()) ::
  {:ok, Mobilizon.Actors.Actor.t()} | {:error, Ecto.Changeset.t()}
Link to this function

create_profile(user, username, name, options \\ [])

View Source
@spec generate_username(String.t()) :: String.t()

Removes all spaces, accents, special characters and diacritics from a string to create a plain ascii username (a-z0-9_)

See https://stackoverflow.com/a/37511463

Link to this function

username_and_name(profile_username, profile_name)

View Source
@spec username_and_name(String.t() | nil, String.t() | nil) ::
  {String.t(), String.t()}