From 02d4d027578e1ec752e5e81b2f0f5207ee10ea8e Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 4 Nov 2026 23:56:32 +0300 Subject: [PATCH] fix(instances): a disk resize returns to the Disks sub-tab 607c8381 sent each memory and disk resize back to its own sub-tab, but the disk view's last redirect, the one after a resize was tried, still went to #resize, which opens on the CPU sub-tab. Only the live tests reach it, with a disk to grow: the full live suite failed there on every connection type. The live vCPU test built its post from the page's form, and the page now disables the CPU fields while the VM runs, so the post lacked cur_vcpu and was refused as not a number before the running VM was. It now posts both fields, as the direct post it checks. --- instances/tests/test_live_dataloss.py | 5 +++-- instances/views.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/instances/tests/test_live_dataloss.py b/instances/tests/test_live_dataloss.py index 188d8b30..32c43757 100644 --- a/instances/tests/test_live_dataloss.py +++ b/instances/tests/test_live_dataloss.py @@ -464,8 +464,9 @@ class LiveDataLossTestCase(TestCase): options = form("change_options") self.assertEqual(options["title"], "wvc-title") self.post("change_options", inst, {**options, "description": "wvc-description"}) - # vCPUs are refused: the VM would get them at its next start, past the quota counted now - response = self.post("resizevm_cpu", inst, {**form("resizevm_cpu"), "vcpu": "2"}) + # vCPUs are refused: the VM would get them at its next start, past the quota counted now; + # the page disables their fields while it runs, so this is a direct post of both + response = self.post("resizevm_cpu", inst, {**form("resizevm_cpu"), "vcpu": "2", "cur_vcpu": "1"}) self.assertIn("Shut off the VM to change its vCPUs", [str(m) for m in get_messages(response.wsgi_request)]) diff --git a/instances/views.py b/instances/views.py index 70df142e..c9d0d702 100755 --- a/instances/views.py +++ b/instances/views.py @@ -1271,7 +1271,7 @@ def resize_disk(request, pk): continue messages.success(request, _("Disk is resized: %(dev)s") % {"dev": disk["dev"]}) - return redirect(reverse("instances:instance", args=[instance.id]) + "#resize") + return redirect(reverse("instances:instance", args=[instance.id]) + "#resizevm_disk") @require_POST