Closed rebeccacremona closed 1 year ago
I tested the data migrations locally with a prod-like dump, and found it to be zippy: like 7 or 8 seconds.
Merging #3328 (9ef573b) into develop (6f09766) will increase coverage by
0.09%
. The diff coverage is90.32%
.
@@ Coverage Diff @@
## develop #3328 +/- ##
===========================================
+ Coverage 70.17% 70.27% +0.09%
===========================================
Files 55 55
Lines 6977 6997 +20
===========================================
+ Hits 4896 4917 +21
+ Misses 2081 2080 -1
Impacted Files | Coverage Δ | |
---|---|---|
perma_web/perma/admin.py | 87.46% <ø> (ø) |
|
perma_web/perma/views/common.py | 83.13% <ø> (ø) |
|
perma_web/tasks/dev.py | 0.00% <0.00%> (ø) |
|
perma_web/perma/views/user_management.py | 94.83% <92.85%> (+0.14%) |
:arrow_up: |
perma_web/perma/forms.py | 95.32% <100.00%> (+0.08%) |
:arrow_up: |
perma_web/perma/models.py | 86.31% <100.00%> (+0.11%) |
:arrow_up: |
Note that email
isn't included in API results, which means we don't have to worry about email
/raw_email
in the JS or anywhere upstream.
This PR makes login case-insensitive, and ensures at the database level that no "duplicative" accounts can exist. It cannot be deployed until the existing duplicative accounts are merged, using the code in the former PR and a small amount of manual clean up.
UNIQUE lower(email)
index to the DB so that, even if something goes wrong at the application layer, no more duplicative accounts can be created.clean
phase, so that logins and password resets are case-insensitive.raw_email
as is, and a lowercase version is saved inemail
.raw_email
field.The unit tests are fairly extensive, so I am pretty confident this works as intended.
However, there is definitely the possibility that I am missing something. Can we think of anything I'm missing? Can we think of anything this might break that wouldn't normally be covered by a test suite?
Tentatively closes https://github.com/harvard-lil/perma/issues/3152
NB
This code should not be merged until we are ready to deploy it, just in case.
Before we deploy it, Ben and I intend to contribute a few more bits of code:
I am not marking it a draft, in order to request reviews.