You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ACTUAL: user_manager.find_user_by_email() and user_manager.find_user_by_username() do not ignore special characters, such as _ which is treated as a wildcard. This results in finding emails and usernames that should not be found. For example, if there is a user with email user1@example.com searching for user_manager.find_user_by_email('user_@example.com') will return the User object for user1@example.com because _ is a wildcard character.
EXPECTED:
Special characters are not used, so user_manager.find_user_by_email('user_@example.com') does not find user1@example.com
DIAGNOSIS:
Both user_manager.find_user_by_email() and user_manager.find_user_by_username() make calls to user_manager.ifind_first_object() which, in an attempt to make case INsensitive lookups, filters using the sql LIKE clause. The LIKE clause uses special characters, such as _, which results in unexpected results.
POTENTIAL SOLUTION:
Instead of using the LIKE clause to do case INsensitive lookups we can use sqlalchemy.func.lower.
The text was updated successfully, but these errors were encountered:
ACTUAL:
user_manager.find_user_by_email()
anduser_manager.find_user_by_username()
do not ignore special characters, such as_
which is treated as a wildcard. This results in finding emails and usernames that should not be found. For example, if there is a user with emailuser1@example.com
searching foruser_manager.find_user_by_email('user_@example.com')
will return theUser
object foruser1@example.com
because_
is a wildcard character.EXPECTED:
Special characters are not used, so
user_manager.find_user_by_email('user_@example.com')
does not finduser1@example.com
DIAGNOSIS:
Both
user_manager.find_user_by_email()
anduser_manager.find_user_by_username()
make calls touser_manager.ifind_first_object()
which, in an attempt to make case INsensitive lookups, filters using the sql LIKE clause. The LIKE clause uses special characters, such as_
, which results in unexpected results.POTENTIAL SOLUTION:
Instead of using the LIKE clause to do case INsensitive lookups we can use sqlalchemy.func.lower.
The text was updated successfully, but these errors were encountered: