Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9c349e8
feat: added scripts to backend folder with json data
freaky4wrld Mar 13, 2024
fd33817
feat: added test-data.json file
freaky4wrld May 11, 2024
2c09b8d
.toLowerString() added
pluto-bell Nov 12, 2024
2a4b402
validate email addition
pluto-bell Nov 12, 2024
66f9339
removed validate email, read note in pr
pluto-bell Nov 12, 2024
0e6aae6
Merge branch 'development' into add-tolowercase-db-query
JackHaeg Mar 11, 2025
14e5767
Merge branch 'pr/1612' into correct-db-casing
trillium Mar 25, 2025
8fd5530
Merge branch 'pr/1811' into correct-db-casing
trillium Mar 25, 2025
2975599
Enforce that emails can only be stored in lowercase
dannyprikaz Jul 11, 2025
41fe687
Merge branch 'development' of https://github.com/hackforla/vrms into …
dannyprikaz Jul 11, 2025
6631aca
Implement script to identify problem users
dannyprikaz Jul 14, 2025
5017c2e
Add method for merging duplicate users
dannyprikaz Jul 29, 2025
040065a
Merge branch 'development' of https://github.com/hackforla/vrms into …
dannyprikaz Jul 29, 2025
a6ff776
Add test to ensure user model sets emails to lowercase
dannyprikaz Aug 3, 2025
2b9223c
Merge pull request #1979 from dannyprikaz/enforce-lowercase-db
dannyprikaz Aug 3, 2025
06ed72f
Add functionality to update checkins with new user_id
dannyprikaz Aug 5, 2025
1520406
Merge branch 'development' of https://github.com/hackforla/vrms into …
dannyprikaz Aug 5, 2025
0328e87
Merge branch 'correct-db-casing' of https://github.com/hackforla/vrms…
dannyprikaz Aug 5, 2025
53a294f
Use sets to keep array fields from getting duplicate entries
dannyprikaz Aug 5, 2025
c528c69
Remove mongo url from code, and clean up notes
dannyprikaz Aug 5, 2025
0d36b7a
Merge pull request #1991 from dannyprikaz/db-script
trillium Aug 8, 2025
71b0efd
Merge branch 'development' into correct-db-casing
dannyprikaz Aug 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const userSchema = mongoose.Schema({
firstName: { type: String },
lastName: { type: String },
},
email: { type: String, unique: true },
email: { type: String, unique: true, lowercase: true },
accessLevel: {
type: String,
enum: ["user", "admin", "superadmin"], // restricts values to "user", "admin" and "superadmin"
Expand Down
13 changes: 13 additions & 0 deletions backend/models/user.model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ describe('Unit tests for User Model', () => {
expect(error.errors.accessLevel).toBeDefined();
});

it('should enforce that emails are stored in lowercase', async () => {
// Create a mock user with an uppercase email
const uppercaseEmail = '[email protected]';
const mockUser = new User({
email: uppercaseEmail,
});

mockUser.validate();
// Tests
expect(mockUser.email).toBe(uppercaseEmail.toLowerCase());
});


it('should pass validation with valid user data', async () => {
// Create a mock user with valid data
const mockUser = new User({
Expand Down
2 changes: 2 additions & 0 deletions backend/scripts/python/env/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Created by venv; see https://docs.python.org/3/library/venv.html
*
Loading
Loading