dataviz: do not refresh subfilters for bijoe stat (#66936)
This commit is contained in:
parent
6807e032a7
commit
10b127edd3
|
@ -89,7 +89,7 @@ class DatavizGraphView(DetailView):
|
||||||
else:
|
else:
|
||||||
return self.error(_('Unknown HTTP error: %s' % e))
|
return self.error(_('Unknown HTTP error: %s' % e))
|
||||||
|
|
||||||
if self.filters_cell_id:
|
if self.filters_cell_id and self.cell.statistic.service_slug != 'bijoe':
|
||||||
self.update_subfilters_cache(form.instance)
|
self.update_subfilters_cache(form.instance)
|
||||||
|
|
||||||
if self.cell.chart_type == 'table':
|
if self.cell.chart_type == 'table':
|
||||||
|
|
|
@ -2687,3 +2687,15 @@ def test_chart_filters_cell_dynamic_subfilters(new_api_statistics, app, admin_us
|
||||||
resp = app.get(location + '?filter-form=food-request&filters_cell_id=xxx')
|
resp = app.get(location + '?filter-form=food-request&filters_cell_id=xxx')
|
||||||
assert 'filter-form' in resp.form.fields
|
assert 'filter-form' in resp.form.fields
|
||||||
assert 'filter-menu' in resp.form.fields
|
assert 'filter-menu' in resp.form.fields
|
||||||
|
|
||||||
|
|
||||||
|
@with_httmock(bijoe_mock)
|
||||||
|
def test_chart_filters_cell_dynamic_subfilters_bijoe(app, statistics):
|
||||||
|
page = Page.objects.create(title='One', slug='index')
|
||||||
|
ChartFiltersCell.objects.create(page=page, order=1, placeholder='content')
|
||||||
|
cell = ChartNgCell.objects.create(page=page, order=2, placeholder='content')
|
||||||
|
cell.statistic = Statistic.objects.get(slug='example')
|
||||||
|
cell.save()
|
||||||
|
|
||||||
|
resp = app.get('/api/dataviz/graph/%s/' % cell.pk + '?filters_cell_id=xxx')
|
||||||
|
assert 'pygal-chart' in resp.text
|
||||||
|
|
Loading…
Reference in New Issue