mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix(tags): audit: races, a taken name, case
- A VM's tags set while its host's list drops it: the VM is checked again under the ownership lock and the page says it was moved, instead of a 500 or a success that kept the old tags in its removed record. - A tag deleted right after another rename cleans the removed VMs' kept name it has now; a delete sent while a backup schedule uses the tag (saved after the page was shown) is refused with the schedules' names. - A rename to a name another tag took meanwhile is a form error, not a 500; "There is a tag with this name already" is translated. - Tom Select makes a typed name lower case and offers no new tag for one that is there in another case; the API's ?tag= is lower-cased too.
This commit is contained in:
parent
904dd860d0
commit
45225df1a4
11 changed files with 198 additions and 114 deletions
|
|
@ -54,6 +54,7 @@ class TagForm(forms.ModelForm):
|
|||
class Meta:
|
||||
model = Tag
|
||||
fields = ["name"]
|
||||
error_messages = {"name": {"unique": _("There is a tag with this name already")}}
|
||||
|
||||
def clean_name(self):
|
||||
return self.cleaned_data["name"].strip().lower()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue