1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(storages): a refused new volume comes back in its dialog

A New volume form the pool page refused, for a name with a space or a
character not allowed, redirected back with the reasons at the top of
the page and lost what was typed.

The form now posts to the pool page itself: a valid one makes the
volume and redirects as before, a refused one renders the page with
the dialog open on what was entered, the refused field marked with its
reason and focused. A pool stopped meanwhile has no dialog: its page
shows the reasons. The separate create_volume view and URL go.
This commit is contained in:
catborise 2026-10-31 18:05:34 +03:00
parent 9d3e3bd315
commit f77439f398
7 changed files with 63 additions and 81 deletions

View file

@ -153,18 +153,6 @@ class InstancesTestCase(TestCase):
)
self.assertRaises(Http404)
# def test_create_volume(self):
# response = self.client.post(
# reverse('create_volume', args=[self.compute.id, 'default']),
# {
# 'name': 'test',
# 'format': 'qcow2',
# 'size': '1',
# 'meta_prealloc': False,
# },
# )
# self.assertRedirects(response, reverse('storage', args=[self.compute.id, 'default']))
def test_create_destroy_instance(self):
# Create
response = self.client.get(
@ -1126,18 +1114,6 @@ class InstancesTestCase(TestCase):
# del self.instance.status
# self.assertEqual(self.instance.status, 1)
# # create volume
# response = self.client.post(
# reverse('create_volume', args=[compute.id, 'default']),
# {
# 'name': 'test3',
# 'format': 'qcow2',
# 'size': '1',
# 'meta_prealloc': False,
# },
# )
# self.assertRedirects(response, reverse('storage', args=[compute.id, 'default']))
# # delete volume
# response = self.client.post(
# reverse('instances:delete_vol', args=[instance.id]),