Merge pull request #27 from fly-apps/gr-github-username

Allow GitHub usernames with uppercase characters
This commit is contained in:
Chris McCord 2022-02-02 10:42:11 -05:00 committed by GitHub
commit 6d39e774e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"
} }