Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NEETzsche
pleroma
Commits
47684c2a
Commit
47684c2a
authored
7 years ago
by
lain
Browse files
Options
Downloads
Patches
Plain Diff
Make email and nickname case insensitive.
parent
9d97be44
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
priv/repo/migrations/20170522160642_case_insensivtivity.exs
+19
-0
19 additions, 0 deletions
priv/repo/migrations/20170522160642_case_insensivtivity.exs
test/user_test.exs
+7
-0
7 additions, 0 deletions
test/user_test.exs
with
26 additions
and
0 deletions
priv/repo/migrations/20170522160642_case_insensivtivity.exs
0 → 100644
+
19
−
0
View file @
47684c2a
defmodule
Pleroma
.
Repo
.
Migrations
.
CaseInsensivtivity
do
use
Ecto
.
Migration
def
up
do
execute
(
"create extension if not exists citext"
)
alter
table
(
:users
)
do
modify
:email
,
:citext
modify
:nickname
,
:citext
end
end
def
down
do
alter
table
(
:users
)
do
modify
:email
,
:string
modify
:nickname
,
:string
end
execute
(
"drop extension if exists citext"
)
end
end
This diff is collapsed.
Click to expand it.
test/user_test.exs
+
7
−
0
View file @
47684c2a
...
...
@@ -114,6 +114,13 @@ test "gets an existing user" do
assert
user
==
fetched_user
end
test
"gets an existing user, case insensitive"
do
user
=
insert
(
:user
,
nickname:
"nick"
)
fetched_user
=
User
.
get_or_fetch_by_nickname
(
"NICK"
)
assert
user
==
fetched_user
end
test
"fetches an external user via ostatus if no user exists"
do
fetched_user
=
User
.
get_or_fetch_by_nickname
(
"shp@social.heldscal.la"
)
assert
fetched_user
.
nickname
==
"shp@social.heldscal.la"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment