mirror of
https://github.com/wassname/flask-security.git
synced 2026-10-01 12:00:44 +08:00
Fail silently for get_user(None)
get_user(identifier) checks if the identifier is a number by trying to convert it to int. This works for strings, but in a particular case, when identifier is None, it fails. Checking for both TypeError and ValueError fixes it.
This commit is contained in:
1 parent
c7d0ea9cce
commit
7e4fc94601
1 file changed
+1
-1
@@ -195,7 +195,7 @@ class SQLAlchemyUserDatastore(SQLAlchemyDatastore, UserDatastore):
|
||||
def _is_numeric(self, value):
|
||||
try:
|
||||
int(value)
|
||||
except ValueError:
|
||||
except (TypeError, ValueError):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in new issue
Block a user