1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-14 02:34:22 +02:00

Merge pull request #699 from usrpro/fix-admin-bug

Fixed admin_1 errors in the logs
This commit is contained in:
mergify[bot] 2018-11-06 18:10:52 +00:00 committed by GitHub
commit 12689965bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,11 +35,14 @@ class IdnaEmail(db.TypeDecorator):
impl = db.String(255, collation="NOCASE")
def process_bind_param(self, value, dialect):
localpart, domain_name = value.split('@')
return "{0}@{1}".format(
localpart,
idna.encode(domain_name).decode('ascii'),
)
try:
localpart, domain_name = value.split('@')
return "{0}@{1}".format(
localpart,
idna.encode(domain_name).decode('ascii'),
)
except ValueError:
pass
def process_result_value(self, value, dialect):
localpart, domain_name = value.split('@')