1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-05-21 22:33:16 +02:00

Don't bother running the query without an address

This should solve the following in admin logs:
"WARNING in nginx: Invalid user 'xxxx': (builtins.ValueError)
invalid email address (no "@")"
This commit is contained in:
Florent Daigniere 2022-03-05 14:33:20 +01:00
parent 2e9b14d536
commit dc81979550

View File

@ -636,7 +636,7 @@ in clear-text regardless of the presence of the cache.
@classmethod @classmethod
def get(cls, email): def get(cls, email):
""" find user object for email address """ """ find user object for email address """
return cls.query.get(email) '@' in email and return cls.query.get(email)
@classmethod @classmethod
def login(cls, email, password): def login(cls, email, password):