mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix(tags): second audit: unchanged saves, report, other lists, hosts list
- Saving a VM's tags unchanged writes no audit row. - The VM report has a Tags column. - A host's VM list and a user's VMs (account page) show the VMs' tags. - The hosts list says "No host matches the filters." with Clear the filters, as the VM list does; the tag list keeps to a phone's width with a long tag. - A removed VM's delete page says its owners and tags no longer come back; the VM history rows say "owners and tags kept/restored". - The API's ?tag= is trimmed; Tom Select's "Add tag" line shows the name in lower case as it is made; Bulk Migrate's tag list goes back to its title after a choice, so the same tag can be chosen again.
This commit is contained in:
parent
45225df1a4
commit
b74e798e70
23 changed files with 376 additions and 324 deletions
|
|
@ -14,7 +14,7 @@ TAG_PARAMETER = OpenApiParameter("tag", str, description="Only those with this t
|
|||
|
||||
def with_tag(queryset, request):
|
||||
"""queryset's VMs or hosts with the ?tag= of request, all without one; their tags read at once."""
|
||||
tag = request.query_params.get("tag", "").lower() # the names are kept in lower case
|
||||
tag = request.query_params.get("tag", "").strip().lower() # the names are kept in lower case
|
||||
return (queryset.filter(tags__name=tag) if tag else queryset).prefetch_related("tags")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue