From be00b1cf8ef4638aaa34490c5a153052ccb868b2 Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 8 Oct 2026 08:32:10 +0300 Subject: [PATCH] fix(instances): a paused VM can be destroyed from its page The Destroy button was disabled and the confirmation page refused a paused VM ("Instance is suspended, cannot destroy!"), while the destroy request itself stops a paused VM like a running one. Both now offer it. --- .../instances/destroy_instance_form.html | 42 ++++++++----------- .../templates/instances/destroy_tab.html | 6 +-- instances/test_destroy.py | 6 +++ instances/test_page_controls.py | 5 +++ 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/instances/templates/instances/destroy_instance_form.html b/instances/templates/instances/destroy_instance_form.html index 5420fd17..0594c5ba 100644 --- a/instances/templates/instances/destroy_instance_form.html +++ b/instances/templates/instances/destroy_instance_form.html @@ -10,32 +10,26 @@ {% block content %} {% if can_delete %} - {% if instance.status == 3 %} -
- {% trans "Instance is suspended, cannot destroy!" %} +
+ {% trans "This action is irreversible!" %} +
+
{% csrf_token %} +
+ +
- {% else %} -
- {% trans "This action is irreversible!" %} + {% if instance.nvram %} +
+ +
- {% csrf_token %} -
- - -
- {% if instance.nvram %} -
- - -
- {% endif %} - - - {% endif %} + {% endif %} + + {% else %}