Allow GitHub usernames with uppercase characters

This commit is contained in:
Gary Rennie 2022-02-02 15:41:09 +00:00
parent fa8d7f6692
commit eb7b12d1f9
2 changed files with 2 additions and 2 deletions

View file

@ -73,7 +73,7 @@ defmodule LiveBeats.Accounts.User do
defp validate_username(changeset) do defp validate_username(changeset) do
changeset changeset
|> validate_format(:username, ~r/^[a-z0-9_-]{2,32}$/) |> validate_format(:username, ~r/^[a-zA-Z0-9_-]{2,32}$/)
|> unsafe_validate_unique(:username, LiveBeats.Repo) |> unsafe_validate_unique(:username, LiveBeats.Repo)
|> unique_constraint(:username) |> unique_constraint(:username)
|> prepare_changes(fn changeset -> |> prepare_changes(fn changeset ->

View file

@ -22,7 +22,7 @@ defmodule LiveBeats.AccountsTest do
test "creates users with valid data" do test "creates users with valid data" do
info = %{ info = %{
"id" => "github-id", "id" => "github-id",
"login" => "chrismccord", "login" => "Chrismccord",
"avatar_url" => "https://example.com", "avatar_url" => "https://example.com",
"html_url" => "https://example.com" "html_url" => "https://example.com"
} }