From 37645b3508a3232f55763cf8c06dcf0b77d612a6 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 24 Oct 2026 11:19:02 +0300 Subject: [PATCH] fix(instances): a refused XML definition comes back in its editor On the machine step, "Or define it from XML" lost the definition when it was refused: a taken name re-rendered the page with an empty, collapsed editor; malformed XML went on to libvirt, and libvirt's refusal sent the browser back to an empty page with the reason at the top. All three refusals now render the page with the section open, the submitted XML in the editor (and in the field it posts, so it can be sent again unchanged), and the reason above the editor, which takes the focus. Fixes #174 --- instances/templates/create_instance_w1.html | 9 +++--- instances/tests/test_create_form_input.py | 32 +++++++++++++++++++++ instances/views.py | 20 +++++++------ 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/instances/templates/create_instance_w1.html b/instances/templates/create_instance_w1.html index a532569a..6e33af42 100644 --- a/instances/templates/create_instance_w1.html +++ b/instances/templates/create_instance_w1.html @@ -48,14 +48,15 @@

-
+
{% csrf_token %} - -
+ {% if xml_error %}{% endif %} + +