mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-21 23:50:59 +00:00
Merge pull request #27 from fly-apps/gr-github-username
Allow GitHub usernames with uppercase characters
This commit is contained in:
commit
6d39e774e6
2 changed files with 2 additions and 2 deletions
|
@ -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 ->
|
||||||
|
|
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue