Fix map check in DataLayerUpdate view

This commit is contained in:
Yohan Boniface 2023-09-08 15:22:08 +02:00
parent 70a1a1d584
commit ee9acf3427

View file

@ -914,7 +914,7 @@ class DataLayerUpdate(FormLessEditMixin, GZipMixin, UpdateView):
def post(self, request, *args, **kwargs):
self.object = self.get_object()
if self.object.map != self.kwargs["map_inst"]:
if self.object.map.pk != int(self.kwargs["map_id"]):
return HttpResponseForbidden()
if not self.object.can_edit(user=self.request.user, request=self.request):
return HttpResponseForbidden()