misc: force labels to be text for json view (#35885)

This commit is contained in:
Frédéric Péters 2019-09-06 14:18:30 +02:00
parent 7bb07886b8
commit 789d2d2d9b
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import hashlib
import json
from django.conf import settings
from django.utils.encoding import force_text
from django.utils.text import slugify
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.views.generic.list import MultipleObjectMixin
@ -301,7 +302,7 @@ class VisualizationJSONView(generics.GenericAPIView):
}
elif len(drilldowns) == 1:
table = list(visualization.data())
axis_data = [(x[0]['value'] or '').strip() for x in table]
axis_data = [force_text(x[0]['value'] or '').strip() for x in table]
data = [x[1]['value'] for x in table]
if visualization.drilldown_x:
axis = {'x_labels': axis_data}