1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 04:06:47 +00:00

fix(instances): the VM lists show the VMs by name

The Instances page (grouped and not) and a host's Instances page read
the VMs without an order, so they showed in whatever order the database
returned them: insertion order on SQLite, any order on PostgreSQL,
where it changed between page loads and made a state test fail at
random in CI. They are now ordered by name.
This commit is contained in:
catborise 2026-10-27 16:03:36 +03:00
parent 1284b93705
commit 2f5e3ccf62
3 changed files with 21 additions and 7 deletions

View file

@ -104,9 +104,7 @@ def instances(request, compute_id):
compute = get_object_or_404(Compute, pk=compute_id)
utils.refresh_instance_database(compute)
instances = Instance.objects.filter(compute=compute).prefetch_related(
"userinstance_set"
)
instances = Instance.objects.filter(compute=compute).order_by("name").prefetch_related("userinstance_set")
return render(
request, "computes/instances.html",