1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Catch the ValueError instead

This commit is contained in:
Florent Daigniere 2022-03-05 18:01:30 +01:00
parent 08aa32a5df
commit 8cf76afbab

View File

@ -95,6 +95,8 @@ def handle_authentication(headers):
try:
user = models.User.query.get(user_email)
is_valid_user = True
except ValueError:
pass
except sqlalchemy.exc.StatementError as exc:
exc = str(exc).split('\n', 1)[0]
app.logger.warn(f'Invalid user {user_email!r}: {exc}')