From eb7b12d1f94ad44331affce7c2c91f4a93b09c9e Mon Sep 17 00:00:00 2001 From: Gary Rennie Date: Wed, 2 Feb 2022 15:41:09 +0000 Subject: [PATCH] Allow GitHub usernames with uppercase characters --- lib/live_beats/accounts/user.ex | 2 +- test/live_beats/accounts_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/live_beats/accounts/user.ex b/lib/live_beats/accounts/user.ex index 6a10dac..8db3786 100644 --- a/lib/live_beats/accounts/user.ex +++ b/lib/live_beats/accounts/user.ex @@ -73,7 +73,7 @@ defmodule LiveBeats.Accounts.User do defp validate_username(changeset) do 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) |> unique_constraint(:username) |> prepare_changes(fn changeset -> diff --git a/test/live_beats/accounts_test.exs b/test/live_beats/accounts_test.exs index 00af66d..37c5e74 100644 --- a/test/live_beats/accounts_test.exs +++ b/test/live_beats/accounts_test.exs @@ -22,7 +22,7 @@ defmodule LiveBeats.AccountsTest do test "creates users with valid data" do info = %{ "id" => "github-id", - "login" => "chrismccord", + "login" => "Chrismccord", "avatar_url" => "https://example.com", "html_url" => "https://example.com" }