Refactor authentication services to async password handling; optimize bulk operations and queries
- Updated `verify_password` and `get_password_hash` to their async counterparts to prevent event loop blocking. - Replaced N+1 query patterns in `admin.py` and `session_async.py` with optimized bulk operations for improved performance. - Enhanced `user_async.py` with bulk update and soft delete methods for efficient user management. - Added eager loading support in CRUD operations to prevent N+1 query issues. - Updated test cases with stronger password examples for better security representation.
This commit is contained in:
@@ -111,7 +111,7 @@ class TestPhoneNumberValidation:
|
||||
email="test@example.com",
|
||||
first_name="Test",
|
||||
last_name="User",
|
||||
password="Password123",
|
||||
password="Password123!",
|
||||
phone_number="+41791234567"
|
||||
)
|
||||
assert user.phone_number == "+41791234567"
|
||||
@@ -122,6 +122,6 @@ class TestPhoneNumberValidation:
|
||||
email="test@example.com",
|
||||
first_name="Test",
|
||||
last_name="User",
|
||||
password="Password123",
|
||||
password="Password123!",
|
||||
phone_number="invalid-number"
|
||||
)
|
||||
Reference in New Issue
Block a user