Convert dimension value type from byte to str in MonascaProxyView

To get the dimension value, urllib.parse.unquote() func is used in
MonascaProxyView._convert_dimensions. urllib.parse.unquote() func
requires str only until python3.8.

Change-Id: Ib52b4c2065dee10a96f1644cf1ec474b60147d87
This commit is contained in:
okozachenko 2021-10-02 18:38:45 +02:00
parent 884eea8219
commit 99591546cf

View File

@ -281,6 +281,8 @@ class MonascaProxyView(TemplateView):
if len(dimension_name_value) == 2:
name = dimension_name_value[0]
value = dimension_name_value[1]
if isinstance(value, bytes):
value = value.decode("utf-8")
dim_dict[name] = urllib.parse.unquote(value)
else:
raise Exception('Dimensions are malformed')