Update error messages for clarity

This commit is contained in:
José Valim 2023-07-28 21:05:27 +02:00
parent 3afd26cd69
commit c24a4f4f7f
2 changed files with 4 additions and 2 deletions

View file

@ -92,7 +92,7 @@ defmodule Livebook.Notebook.AppSettings do
:output_type
])
|> validate_format(:slug, ~r/^[a-zA-Z0-9-]+$/,
message: "slug can only contain alphanumeric characters and dashes"
message: "should only contain alphanumeric characters and dashes"
)
|> cast_access_attrs(attrs)
|> cast_mode_specific_attrs(attrs)

View file

@ -48,7 +48,9 @@ defmodule Livebook.Teams.Org do
org
|> cast(attrs, @fields)
|> validate_required(@required_fields)
|> validate_format(:name, ~r/^[a-z0-9][a-z0-9\-]*$/)
|> validate_format(:name, ~r/^[a-z0-9][a-z0-9\-]*$/,
message: "should only contain alphanumeric characters and dashes"
)
end
@doc """