From 6dcc33e390003c1f1ea0955ec260ae2f9c776d2a Mon Sep 17 00:00:00 2001 From: Ionut Filip Date: Fri, 2 Nov 2018 12:14:23 +0200 Subject: [PATCH] Fixed admin_1 errors in the logs Fixed errors when trying to log in with an account without domain. This closes #585 --- core/admin/mailu/models.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py index 62c25c81..cd37f76c 100644 --- a/core/admin/mailu/models.py +++ b/core/admin/mailu/models.py @@ -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: + pass def process_result_value(self, value, dialect): localpart, domain_name = value.split('@')