Commit 7abcec33 by Kálmán Viktor

request: fix disk resize view permission problem

parent 8dc295a5
...@@ -305,7 +305,10 @@ class ResizeRequestView(VmRequestMixin, FormView): ...@@ -305,7 +305,10 @@ class ResizeRequestView(VmRequestMixin, FormView):
success_message = _("Request successfully sent.") success_message = _("Request successfully sent.")
def get_disk(self, *args, **kwargs): def get_disk(self, *args, **kwargs):
return get_object_or_404(Disk, pk=self.kwargs['disk_pk']) disk = get_object_or_404(Disk, pk=self.kwargs['disk_pk'])
if disk not in self.get_vm().disks.all():
raise SuspiciousOperation
return disk
def get_form_kwargs(self): def get_form_kwargs(self):
kwargs = super(ResizeRequestView, self).get_form_kwargs() kwargs = super(ResizeRequestView, self).get_form_kwargs()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment