Merge pull request #790 from koriaf/master

fix<migrations>: correct import of b64decode in migration 0020
This commit is contained in:
Garret Wassermann 2019-12-17 20:45:09 -05:00 committed by GitHub
commit 909ecc400b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: