[fix] preference query parameter decoding (#1599)

Fix issue #1598
This commit is contained in:
rachmadani haryono 2019-07-17 15:42:40 +08:00 committed by Alexandre Flament
parent 582f3bfcbc
commit 8f44014627
2 changed files with 24 additions and 1 deletions

View file

@ -292,7 +292,10 @@ class Preferences(object):
def parse_encoded_data(self, input_data):
decoded_data = decompress(urlsafe_b64decode(input_data.encode('utf-8')))
self.parse_dict({x: y[0] for x, y in parse_qs(unicode(decoded_data)).items()})
dict_data = {}
for x, y in parse_qs(decoded_data).items():
dict_data[x.decode('utf8')] = y[0].decode('utf8')
self.parse_dict(dict_data)
def parse_dict(self, input_data):
for user_setting_name, user_setting in input_data.items():