misc: always pass user as keyword argument to cell.is_visible (#41648)

This commit is contained in:
Frédéric Péters 2020-04-13 17:48:40 +02:00
parent 90a7560e98
commit ef91364999
3 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ class DashboardAddTileView(View):
cell = CellBase.get_cell(kwargs['cell_reference'])
if not cell.page.is_visible(request.user):
raise PermissionDenied()
if not cell.is_visible(request.user):
if not cell.is_visible(user=request.user):
raise PermissionDenied()
cell.pk = None
cell.page = dashboard.page

View File

@ -34,7 +34,7 @@ def dataviz_graph(request, *args, **kwargs):
cell = ChartNgCell.objects.get(id=kwargs.get('cell'))
if not cell.page.is_visible(request.user):
raise PermissionDenied()
if not cell.is_visible(request.user):
if not cell.is_visible(user=request.user):
raise PermissionDenied()
if not cell.cached_json:
raise Http404('misconfigured cell')

View File

@ -29,7 +29,7 @@ class GeojsonView(View):
cell = Map.objects.get(pk=kwargs['cell_id'])
except Map.DoesNotExist:
raise Http404()
if cell.page.is_visible(request.user) and cell.is_visible(request.user):
if cell.page.is_visible(request.user) and cell.is_visible(user=request.user):
geojson = cell.get_geojson(request)
content_type = 'application/json'
return HttpResponse(json.dumps(geojson), content_type=content_type)