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

fix(virtsecrets): the create dialog offers only the usage types it can create

The usage list of the create-secret dialog came from the map that names
the usage types of existing secrets, so it offered none and tls too; the
form takes ceph, volume and iscsi only, and picking none or tls always
failed with "Select a valid choice". The dialog now lists the form's own
choices.
This commit is contained in:
catborise 2026-10-20 22:12:35 +03:00
parent 8c1d7d33bb
commit 084f2e8b60
3 changed files with 21 additions and 4 deletions

View file

@ -33,6 +33,8 @@ def secrets(request, compute_id):
VIR_SECRET_USAGE_TYPE_ISCSI: "iscsi",
VIR_SECRET_USAGE_TYPE_TLS: "tls",
}
# the create dialog offers the usage types the form takes
usage_choices = AddSecret.base_fields["usage_type"].choices
try:
conn = wvmSecrets(