From ed3fd8e8bfcc80681d16a57ce44c724f3c006df1 Mon Sep 17 00:00:00 2001 From: Anthony Bourguignon Date: Thu, 18 Oct 2018 21:40:06 +0200 Subject: [PATCH] fix a bug with python3 showing no scheme available in settings --- modoboa/core/password_hashers/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modoboa/core/password_hashers/__init__.py b/modoboa/core/password_hashers/__init__.py index 661251784..b03b5e3d0 100644 --- a/modoboa/core/password_hashers/__init__.py +++ b/modoboa/core/password_hashers/__init__.py @@ -6,6 +6,8 @@ Password hashers for Modoboa. from __future__ import unicode_literals +from django.utils.encoding import smart_text + from modoboa.core.password_hashers.advanced import ( # NOQA:F401 BLFCRYPTHasher, MD5CRYPTHasher, SHA256CRYPTHasher, SHA512CRYPTHasher ) @@ -40,7 +42,7 @@ def get_dovecot_schemes(): except OSError: pass else: - supported_schemes = ["{{{}}}".format(scheme) + supported_schemes = ["{{{}}}".format(smart_text(scheme)) for scheme in schemes.split()] if not supported_schemes: