From 015b2267666c05ff6568040f64da1cec35f3489c Mon Sep 17 00:00:00 2001 From: Arkadiy Korotaev Date: Tue, 17 Dec 2019 19:25:45 +0100 Subject: [PATCH] fix: correct import of b64decode in migration 0020 --- helpdesk/migrations/0020_depickle_user_settings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/helpdesk/migrations/0020_depickle_user_settings.py b/helpdesk/migrations/0020_depickle_user_settings.py index 4315c8fd..bf077b95 100644 --- a/helpdesk/migrations/0020_depickle_user_settings.py +++ b/helpdesk/migrations/0020_depickle_user_settings.py @@ -9,7 +9,12 @@ def unpickle_settings(settings_pickled): import pickle except ImportError: import cPickle as pickle - from helpdesk.lib import b64decode + try: + # Python 2 support + from base64 import urlsafe_b64decode as b64decode + except ImportError: + # Python 3 support + from base64 import decodebytes as b64decode try: return pickle.loads(b64decode(settings_pickled.encode('utf-8'))) except Exception: