From 99591546cf690324a03a4f8b50a2df090c2acbce Mon Sep 17 00:00:00 2001 From: okozachenko Date: Sat, 2 Oct 2021 18:38:45 +0200 Subject: [PATCH] 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 --- monitoring/overview/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitoring/overview/views.py b/monitoring/overview/views.py index c4aefdfa..1169654b 100644 --- a/monitoring/overview/views.py +++ b/monitoring/overview/views.py @@ -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')