1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

fix(accounts): owners given before one owner was the rule keep editable rights

With "Multiple Owner for VM" turned off after a VM was given two owners,
changing either owner's rights (Delete the VM, say) was refused: the
form's one-owner check counted the other owner. The check now applies to
a new owner only, as its message says.

The user and group forms showed the permissions by the English names the
database keeps (Can clone instances, ...), in every language; they are
named in the user's language now.
This commit is contained in:
catborise 2026-11-13 14:27:32 +03:00
parent dde7672375
commit 35a5bbdb62
10 changed files with 151 additions and 100 deletions

View file

@ -21,10 +21,9 @@ class UserInstanceForm(ModelForm):
def clean_instance(self): def clean_instance(self):
instance = self.cleaned_data["instance"] instance = self.cleaned_data["instance"]
if app_settings.ALLOW_INSTANCE_MULTIPLE_OWNER == "False": # a new owner only: rights of one the VM has may still be changed after the setting is turned off
# the ownership being edited is not another owner if app_settings.ALLOW_INSTANCE_MULTIPLE_OWNER == "False" and self.instance.pk is None:
exists = UserInstance.objects.filter(instance=instance).exclude(pk=self.instance.pk) if UserInstance.objects.filter(instance=instance).exists():
if exists:
raise ValidationError(_("Instance owned by another user")) raise ValidationError(_("Instance owned by another user"))
return instance return instance

View file

@ -329,6 +329,12 @@ class SingleOwnerEditTests(TestCase):
self.assertRedirects(response, reverse("accounts:account", args=[bob.pk]), fetch_redirect_response=False) self.assertRedirects(response, reverse("accounts:account", args=[bob.pk]), fetch_redirect_response=False)
ui.refresh_from_db() ui.refresh_from_db()
self.assertTrue(ui.is_vnc) self.assertTrue(ui.is_vnc)
# owners given while more were allowed: each one's rights still change
carol = UserInstance.objects.create(user=get_user_model().objects.create_user("carol"), instance=vm)
response = self.client.post(reverse("accounts:user_instance_update", args=[carol.pk]), {"is_delete": "on"})
self.assertRedirects(response, reverse("accounts:account", args=[carol.user.pk]), fetch_redirect_response=False)
carol.refresh_from_db()
self.assertTrue(carol.is_delete)
class OwnerRightsReturnTestCase(TestCase): class OwnerRightsReturnTestCase(TestCase):

View file

@ -17,6 +17,15 @@ from instances.models import Instance
from .models import Permission from .models import Permission
# each permission's name in the user's language: the database keeps the English one
PERMISSION_NAMES = {
"change_password": _("Can change password"),
"clone_instances": _("Can clone instances"),
"passwordless_console": _("Can access console without password"),
"snapshot_instances": _("Can snapshot instances"),
"view_instances": _("Can view instances"),
}
# what each permission lets a user do, shown beside its switch # what each permission lets a user do, shown beside its switch
PERMISSION_HELP = { PERMISSION_HELP = {
"change_password": _("Change their own password on their profile page"), "change_password": _("Change their own password on their profile page"),
@ -28,8 +37,13 @@ PERMISSION_HELP = {
def permission_rows(field): def permission_rows(field):
"""Each permission's checkbox of a bound field with what it lets a user do.""" """Each permission's checkbox of a bound field with its name and what it lets a user do."""
return [(box, PERMISSION_HELP.get(box.data["value"].instance.codename, "")) for box in field] rows = []
for box in field:
permission = box.data["value"].instance
rows.append((box, PERMISSION_NAMES.get(permission.codename, permission.name),
PERMISSION_HELP.get(permission.codename, "")))
return rows
class GroupForm(forms.ModelForm): class GroupForm(forms.ModelForm):

View file

@ -32,12 +32,12 @@
</div> </div>
<div class="col-lg-9 form-section-fields"> <div class="col-lg-9 form-section-fields">
<div class="border-top"> <div class="border-top">
{% for box, help in form.permission_rows %} {% for box, name, help in form.permission_rows %}
<div class="form-check form-switch border-bottom py-2 ps-5"> <div class="form-check form-switch border-bottom py-2 ps-5">
<input id="{{ box.id_for_label }}" class="form-check-input" type="checkbox" role="switch" name="permissions" <input id="{{ box.id_for_label }}" class="form-check-input" type="checkbox" role="switch" name="permissions"
value="{{ box.data.value }}"{% if box.data.selected %} checked{% endif %}> value="{{ box.data.value }}"{% if box.data.selected %} checked{% endif %}>
<label class="form-check-label" for="{{ box.id_for_label }}"> <label class="form-check-label" for="{{ box.id_for_label }}">
<span class="d-block">{{ box.data.value.instance.name }}</span> <span class="d-block">{{ name }}</span>
<span class="small text-body-secondary">{{ help }}</span> <span class="small text-body-secondary">{{ help }}</span>
</label> </label>
</div> </div>

View file

@ -137,12 +137,12 @@
<legend class="visually-hidden">{% trans "Own permissions" %}</legend> <legend class="visually-hidden">{% trans "Own permissions" %}</legend>
<p class="small text-body-secondary mb-2">{% trans "Off grants nothing here; it takes away nothing a group grants." %}</p> <p class="small text-body-secondary mb-2">{% trans "Off grants nothing here; it takes away nothing a group grants." %}</p>
<div class="border-top"> <div class="border-top">
{% for box, help in user_form.permission_rows %} {% for box, name, help in user_form.permission_rows %}
<div class="form-check form-switch border-bottom py-2 ps-5"> <div class="form-check form-switch border-bottom py-2 ps-5">
<input id="{{ box.id_for_label }}" class="form-check-input" type="checkbox" role="switch" name="user_permissions" <input id="{{ box.id_for_label }}" class="form-check-input" type="checkbox" role="switch" name="user_permissions"
value="{{ box.data.value }}"{% if box.data.selected %} checked{% endif %}> value="{{ box.data.value }}"{% if box.data.selected %} checked{% endif %}>
<label class="form-check-label" for="{{ box.id_for_label }}"> <label class="form-check-label" for="{{ box.id_for_label }}">
<span class="d-block">{{ box.data.value.instance.name }}</span> <span class="d-block">{{ name }}</span>
<span class="small text-body-secondary">{{ help }}</span> <span class="small text-body-secondary">{{ help }}</span>
</label> </label>
</div> </div>

View file

@ -44,6 +44,14 @@ class UserCreateTests(TestCase):
ticked = set(re.findall(r'<input[^>]*name="user_permissions"[^>]*value="(\d+)"[^>]*checked', page)) ticked = set(re.findall(r'<input[^>]*name="user_permissions"[^>]*value="(\d+)"[^>]*checked', page))
self.assertEqual(ticked, {str(self.change_password.pk), str(Permission.objects.get(codename="passwordless_console").pk)}) self.assertEqual(ticked, {str(self.change_password.pk), str(Permission.objects.get(codename="passwordless_console").pk)})
def test_permissions_are_named_in_the_users_language(self):
# the database keeps each permission's English name
page = self.client.get(reverse("admin:user_create"), HTTP_ACCEPT_LANGUAGE="tr").content.decode()
for name in ("Parola değiştirebilir", "Sanal makineleri klonlayabilir", "Parolasız konsol erişimi yapabilir",
"Sanal makinelerin anlık görüntüsünü alabilir", "Sanal makineleri görebilir"):
self.assertIn(name, page)
self.assertNotIn("Can clone instances", page)
def test_groups_and_permissions_are_saved(self): def test_groups_and_permissions_are_saved(self):
group = Group.objects.create(name="uc-group") group = Group.objects.create(name="uc-group")
self.create(groups=[group.pk], user_permissions=[self.change_password.pk]) self.create(groups=[group.pk], user_permissions=[self.change_password.pk])

Binary file not shown.

View file

@ -11,7 +11,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-13 11:26+0000\n" "POT-Creation-Date: 2026-11-13 11:27+0000\n"
"PO-Revision-Date: 2020-11-04 12:00+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n"
"Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n" "Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n"
"Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n"
@ -25,46 +25,46 @@ msgstr ""
msgid "Change your password before using the API." msgid "Change your password before using the API."
msgstr "API'yi kullanmadan önce parolanızı değiştirin." msgstr "API'yi kullanmadan önce parolanızı değiştirin."
#: accounts/forms.py:28 #: accounts/forms.py:27
msgid "Instance owned by another user" msgid "Instance owned by another user"
msgstr "Diğer kullanıcıya ait sanal makineler" msgstr "Diğer kullanıcıya ait sanal makineler"
#: accounts/forms.py:36 accounts/templates/account.html:72 #: accounts/forms.py:35 accounts/templates/account.html:72
#: instances/templates/instances/settings_tab.html:676 #: instances/templates/instances/settings_tab.html:676
msgid "Change settings" msgid "Change settings"
msgstr "Ayarları değiştir" msgstr "Ayarları değiştir"
#: accounts/forms.py:36 accounts/templates/account.html:73 #: accounts/forms.py:35 accounts/templates/account.html:73
#: instances/templates/instances/settings_tab.html:676 #: instances/templates/instances/settings_tab.html:676
msgid "Delete the VM" msgid "Delete the VM"
msgstr "Sanal makineyi sil" msgstr "Sanal makineyi sil"
#: accounts/forms.py:37 accounts/templates/account.html:74 #: accounts/forms.py:36 accounts/templates/account.html:74
#: instances/templates/instances/settings_tab.html:676 #: instances/templates/instances/settings_tab.html:676
msgid "Change console settings" msgid "Change console settings"
msgstr "Konsol ayarlarını değiştir" msgstr "Konsol ayarlarını değiştir"
#: accounts/forms.py:38 #: accounts/forms.py:37
msgid "Only together with Change settings" msgid "Only together with Change settings"
msgstr "Yalnızca Ayarları değiştirme ile birlikte" msgstr "Yalnızca Ayarları değiştirme ile birlikte"
#: accounts/forms.py:50 #: accounts/forms.py:49
msgid "Another user has this email address" msgid "Another user has this email address"
msgstr "Bu e-posta adresi başka bir kullanıcıya ait" msgstr "Bu e-posta adresi başka bir kullanıcıya ait"
#: accounts/forms.py:69 #: accounts/forms.py:68
msgid "Key name already exist" msgid "Key name already exist"
msgstr "Anahtar adı zaten mevcut" msgstr "Anahtar adı zaten mevcut"
#: accounts/forms.py:77 #: accounts/forms.py:76
msgid "Public key already exist" msgid "Public key already exist"
msgstr "Açık anahtar zaten mevcut" msgstr "Açık anahtar zaten mevcut"
#: accounts/forms.py:80 #: accounts/forms.py:79
msgid "Invalid key" msgid "Invalid key"
msgstr "Geçersiz anahtar" msgstr "Geçersiz anahtar"
#: accounts/forms.py:96 computes/templates/computes/instances.html:45 #: accounts/forms.py:95 computes/templates/computes/instances.html:45
#: instances/templates/add_instance_volume.html:39 #: instances/templates/add_instance_volume.html:39
#: instances/templates/allinstances_index_grouped.html:11 #: instances/templates/allinstances_index_grouped.html:11
#: instances/templates/allinstances_index_nongrouped.html:6 #: instances/templates/allinstances_index_nongrouped.html:6
@ -76,27 +76,27 @@ msgstr "Geçersiz anahtar"
msgid "Name" msgid "Name"
msgstr "Ad" msgstr "Ad"
#: accounts/forms.py:96 #: accounts/forms.py:95
msgid "What uses it, such as a script or a host" msgid "What uses it, such as a script or a host"
msgstr "Onu ne kullanıyor, örneğin bir betik ya da bir sunucu" msgstr "Onu ne kullanıyor, örneğin bir betik ya da bir sunucu"
#: accounts/forms.py:98 accounts/templates/api_token_list.html:19 #: accounts/forms.py:97 accounts/templates/api_token_list.html:19
msgid "Expires" msgid "Expires"
msgstr "Sona erme" msgstr "Sona erme"
#: accounts/forms.py:99 #: accounts/forms.py:98
msgid "in 30 days" msgid "in 30 days"
msgstr "30 gün içinde" msgstr "30 gün içinde"
#: accounts/forms.py:99 #: accounts/forms.py:98
msgid "in 90 days" msgid "in 90 days"
msgstr "90 gün içinde" msgstr "90 gün içinde"
#: accounts/forms.py:99 #: accounts/forms.py:98
msgid "in a year" msgid "in a year"
msgstr "bir yıl içinde" msgstr "bir yıl içinde"
#: accounts/forms.py:99 accounts/templates/account.html:29 #: accounts/forms.py:98 accounts/templates/account.html:29
#: accounts/templates/api_token_list.html:19 #: accounts/templates/api_token_list.html:19
#: accounts/templates/api_token_list.html:20 accounts/templates/profile.html:25 #: accounts/templates/api_token_list.html:20 accounts/templates/profile.html:25
#: admin/templates/admin/user_form.html:21 #: admin/templates/admin/user_form.html:21
@ -106,7 +106,7 @@ msgstr "bir yıl içinde"
msgid "never" msgid "never"
msgstr "hiçbir zaman" msgstr "hiçbir zaman"
#: accounts/forms.py:104 #: accounts/forms.py:103
msgid "Email" msgid "Email"
msgstr "E-posta" msgstr "E-posta"
@ -144,7 +144,7 @@ msgstr "en fazla bellek (MiB)"
msgid "max disk size (GiB)" msgid "max disk size (GiB)"
msgstr "en fazla disk boyutu (GiB)" msgstr "en fazla disk boyutu (GiB)"
#: accounts/models.py:82 #: accounts/models.py:82 admin/forms.py:22
msgid "Can change password" msgid "Can change password"
msgstr "Parola değiştirebilir" msgstr "Parola değiştirebilir"
@ -162,13 +162,13 @@ msgid "User Profile"
msgstr "Kullanıcı Profili" msgstr "Kullanıcı Profili"
#: accounts/templates/account.html:17 accounts/templates/profile.html:18 #: accounts/templates/account.html:17 accounts/templates/profile.html:18
#: admin/forms.py:75 admin/templates/admin/user_list.html:24 #: admin/forms.py:89 admin/templates/admin/user_list.html:24
#: admin/templates/admin/user_list.html:30 #: admin/templates/admin/user_list.html:30
msgid "Superuser" msgid "Superuser"
msgstr "Süperkullanıcı" msgstr "Süperkullanıcı"
#: accounts/templates/account.html:19 accounts/templates/profile.html:20 #: accounts/templates/account.html:19 accounts/templates/profile.html:20
#: admin/forms.py:75 admin/templates/admin/user_list.html:24 #: admin/forms.py:89 admin/templates/admin/user_list.html:24
#: admin/templates/admin/user_list.html:32 #: admin/templates/admin/user_list.html:32
msgid "Template editor" msgid "Template editor"
msgstr "Şablon düzenleyici" msgstr "Şablon düzenleyici"
@ -214,7 +214,7 @@ msgid "User sections"
msgstr "Kullanıcı bölümleri" msgstr "Kullanıcı bölümleri"
#: accounts/templates/account.html:50 accounts/templates/account.html:58 #: accounts/templates/account.html:50 accounts/templates/account.html:58
#: admin/forms.py:193 computes/templates/computes/list.html:30 #: admin/forms.py:207 computes/templates/computes/list.html:30
#: computes/templates/computes/list.html:57 computes/templates/overview.html:46 #: computes/templates/computes/list.html:57 computes/templates/overview.html:46
msgid "VMs" msgid "VMs"
msgstr "Sanal makineler" msgstr "Sanal makineler"
@ -677,11 +677,27 @@ msgid "OTP of %(user)s was reset: a new QR code can be mailed."
msgstr "" msgstr ""
"%(user)s kullanıcısının OTP'si sıfırlandı: yeni bir QR kodu gönderilebilir." "%(user)s kullanıcısının OTP'si sıfırlandı: yeni bir QR kodu gönderilebilir."
#: admin/forms.py:22 #: admin/forms.py:23
msgid "Can clone instances"
msgstr "Sanal makineleri klonlayabilir"
#: admin/forms.py:24 instances/models.py:436
msgid "Can access console without password"
msgstr "Parolasız konsol erişimi yapabilir"
#: admin/forms.py:25
msgid "Can snapshot instances"
msgstr "Sanal makinelerin anlık görüntüsünü alabilir"
#: admin/forms.py:26
msgid "Can view instances"
msgstr "Sanal makineleri görebilir"
#: admin/forms.py:31
msgid "Change their own password on their profile page" msgid "Change their own password on their profile page"
msgstr "Profil sayfasında kendi parolasını değiştirme" msgstr "Profil sayfasında kendi parolasını değiştirme"
#: admin/forms.py:23 #: admin/forms.py:32
msgid "" msgid ""
"Clone the VMs they may change and the templates they may view, within their " "Clone the VMs they may change and the templates they may view, within their "
"quota" "quota"
@ -689,21 +705,21 @@ msgstr ""
"Kotası dahilinde, değiştirebildiği sanal makineleri ve görebildiği şablonları" "Kotası dahilinde, değiştirebildiği sanal makineleri ve görebildiği şablonları"
" klonlama" " klonlama"
#: admin/forms.py:24 #: admin/forms.py:33
msgid "Open a console without the VM's console password" msgid "Open a console without the VM's console password"
msgstr "Sanal makinenin konsol parolası olmadan konsol aç" msgstr "Sanal makinenin konsol parolası olmadan konsol aç"
#: admin/forms.py:25 #: admin/forms.py:34
msgid "Take, revert and delete snapshots of the VMs they may change" msgid "Take, revert and delete snapshots of the VMs they may change"
msgstr "" msgstr ""
"Değiştirebildiği sanal makinelerin anlık görüntülerini alma, geri yükleme ve " "Değiştirebildiği sanal makinelerin anlık görüntülerini alma, geri yükleme ve "
"silme" "silme"
#: admin/forms.py:26 #: admin/forms.py:35
msgid "See every VM and host in the lists, read-only" msgid "See every VM and host in the lists, read-only"
msgstr "Listelerde tüm sanal makineleri ve sunucuları salt okunur görme" msgstr "Listelerde tüm sanal makineleri ve sunucuları salt okunur görme"
#: admin/forms.py:75 admin/templates/admin/logs.html:39 #: admin/forms.py:89 admin/templates/admin/logs.html:39
#: admin/templates/admin/user_list.html:24 #: admin/templates/admin/user_list.html:24
#: admin/templates/admin/user_list.html:34 #: admin/templates/admin/user_list.html:34
#: computes/templates/computes/instances.html:46 #: computes/templates/computes/instances.html:46
@ -715,24 +731,24 @@ msgstr "Listelerde tüm sanal makineleri ve sunucuları salt okunur görme"
msgid "User" msgid "User"
msgstr "Kullanıcı" msgstr "Kullanıcı"
#: admin/forms.py:82 admin/templates/admin/group_form.html:30 #: admin/forms.py:96 admin/templates/admin/group_form.html:30
msgid "Permissions" msgid "Permissions"
msgstr "İzinler" msgstr "İzinler"
#: admin/forms.py:89 admin/templates/admin/group_list.html:6 #: admin/forms.py:103 admin/templates/admin/group_list.html:6
#: admin/templates/admin/group_list.html:8 #: admin/templates/admin/group_list.html:8
#: admin/templates/admin/group_list.html:24 #: admin/templates/admin/group_list.html:24
#: admin/templates/admin/user_form.html:123 templates/navbar.html:33 #: admin/templates/admin/user_form.html:123 templates/navbar.html:33
msgid "Groups" msgid "Groups"
msgstr "Gruplar" msgstr "Gruplar"
#: admin/forms.py:143 #: admin/forms.py:157
#, python-format #, python-format
msgid "NEW_USER_DEFAULT_INSTANCES: %(name)s is not exactly one VM" msgid "NEW_USER_DEFAULT_INSTANCES: %(name)s is not exactly one VM"
msgstr "" msgstr ""
"NEW_USER_DEFAULT_INSTANCES: %(name)s tam olarak tek bir sanal makine değil" "NEW_USER_DEFAULT_INSTANCES: %(name)s tam olarak tek bir sanal makine değil"
#: admin/forms.py:146 #: admin/forms.py:160
#, python-format #, python-format
msgid "" msgid ""
"NEW_USER_DEFAULT_INSTANCES: %(name)s has an owner, and only one is allowed" "NEW_USER_DEFAULT_INSTANCES: %(name)s has an owner, and only one is allowed"
@ -740,7 +756,7 @@ msgstr ""
"NEW_USER_DEFAULT_INSTANCES: %(name)s sanal makinesinin bir sahibi var ve " "NEW_USER_DEFAULT_INSTANCES: %(name)s sanal makinesinin bir sahibi var ve "
"yalnızca bir sahibe izin veriliyor" "yalnızca bir sahibe izin veriliyor"
#: admin/forms.py:194 computes/templates/computes/list.html:58 #: admin/forms.py:208 computes/templates/computes/list.html:58
#: computes/templates/overview.html:58 instances/forms.py:14 #: computes/templates/overview.html:58 instances/forms.py:14
#: instances/templates/allinstances_index_grouped.html:16 #: instances/templates/allinstances_index_grouped.html:16
#: instances/templates/allinstances_index_nongrouped.html:14 #: instances/templates/allinstances_index_nongrouped.html:14
@ -750,7 +766,7 @@ msgstr ""
msgid "vCPUs" msgid "vCPUs"
msgstr "vCPU" msgstr "vCPU"
#: admin/forms.py:195 computes/templates/computes/instances.html:49 #: admin/forms.py:209 computes/templates/computes/instances.html:49
#: computes/templates/computes/list.html:59 computes/templates/overview.html:66 #: computes/templates/computes/list.html:59 computes/templates/overview.html:66
#: computes/templates/overview.html:150 #: computes/templates/overview.html:150
#: instances/templates/allinstances_index_grouped.html:17 #: instances/templates/allinstances_index_grouped.html:17
@ -762,34 +778,34 @@ msgstr "vCPU"
msgid "Memory" msgid "Memory"
msgstr "Bellek" msgstr "Bellek"
#: admin/forms.py:196 instances/models.py:240 #: admin/forms.py:210 instances/models.py:240
#: instances/templates/create_instance_w2.html:118 #: instances/templates/create_instance_w2.html:118
#: instances/templates/instances/settings_tab.html:25 #: instances/templates/instances/settings_tab.html:25
#: instances/templates/instances/stats_tab.html:53 #: instances/templates/instances/stats_tab.html:53
msgid "Disk" msgid "Disk"
msgstr "Disk" msgstr "Disk"
#: admin/forms.py:206 #: admin/forms.py:220
msgid "No limit" msgid "No limit"
msgstr "Sınır yok" msgstr "Sınır yok"
#: admin/forms.py:222 #: admin/forms.py:236
msgid "Enter a limit or choose No limit." msgid "Enter a limit or choose No limit."
msgstr "Bir sınır girin ya da Sınır yok'u seçin." msgstr "Bir sınır girin ya da Sınır yok'u seçin."
#: admin/forms.py:234 #: admin/forms.py:248
msgid "The user must change it at their next login" msgid "The user must change it at their next login"
msgstr "Kullanıcı bir sonraki girişinde onu değiştirmek zorundadır" msgstr "Kullanıcı bir sonraki girişinde onu değiştirmek zorundadır"
#: admin/forms.py:240 #: admin/forms.py:254
msgid "With a password" msgid "With a password"
msgstr "Parolayla" msgstr "Parolayla"
#: admin/forms.py:240 #: admin/forms.py:254
msgid "Without a password" msgid "Without a password"
msgstr "Parolasız" msgstr "Parolasız"
#: admin/forms.py:246 #: admin/forms.py:260
msgid "A user without a password cannot be made to change it" msgid "A user without a password cannot be made to change it"
msgstr "Parolası olmayan bir kullanıcıya parola değiştirme zorunluluğu konamaz" msgstr "Parolası olmayan bir kullanıcıya parola değiştirme zorunluluğu konamaz"
@ -3360,10 +3376,6 @@ msgstr "CD-ROM"
msgid "NIC" msgid "NIC"
msgstr "NIC" msgstr "NIC"
#: instances/models.py:436
msgid "Can access console without password"
msgstr "Parolasız konsol erişimi yapabilir"
#: instances/states.py:10 #: instances/states.py:10
msgid "No state" msgid "No state"
msgstr "Durum yok" msgstr "Durum yok"

Binary file not shown.

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-13 11:26+0000\n" "POT-Creation-Date: 2026-11-13 11:27+0000\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -22,46 +22,46 @@ msgstr ""
msgid "Change your password before using the API." msgid "Change your password before using the API."
msgstr "使用 API 前请先修改密码。" msgstr "使用 API 前请先修改密码。"
#: accounts/forms.py:28 #: accounts/forms.py:27
msgid "Instance owned by another user" msgid "Instance owned by another user"
msgstr "该虚拟机属于其他用户" msgstr "该虚拟机属于其他用户"
#: accounts/forms.py:36 accounts/templates/account.html:72 #: accounts/forms.py:35 accounts/templates/account.html:72
#: instances/templates/instances/settings_tab.html:676 #: instances/templates/instances/settings_tab.html:676
msgid "Change settings" msgid "Change settings"
msgstr "修改设置" msgstr "修改设置"
#: accounts/forms.py:36 accounts/templates/account.html:73 #: accounts/forms.py:35 accounts/templates/account.html:73
#: instances/templates/instances/settings_tab.html:676 #: instances/templates/instances/settings_tab.html:676
msgid "Delete the VM" msgid "Delete the VM"
msgstr "删除虚拟机" msgstr "删除虚拟机"
#: accounts/forms.py:37 accounts/templates/account.html:74 #: accounts/forms.py:36 accounts/templates/account.html:74
#: instances/templates/instances/settings_tab.html:676 #: instances/templates/instances/settings_tab.html:676
msgid "Change console settings" msgid "Change console settings"
msgstr "修改控制台设置" msgstr "修改控制台设置"
#: accounts/forms.py:38 #: accounts/forms.py:37
msgid "Only together with Change settings" msgid "Only together with Change settings"
msgstr "仅可与“修改设置”一起使用" msgstr "仅可与“修改设置”一起使用"
#: accounts/forms.py:50 #: accounts/forms.py:49
msgid "Another user has this email address" msgid "Another user has this email address"
msgstr "其他用户已使用此邮箱地址" msgstr "其他用户已使用此邮箱地址"
#: accounts/forms.py:69 #: accounts/forms.py:68
msgid "Key name already exist" msgid "Key name already exist"
msgstr "密钥名称已存在" msgstr "密钥名称已存在"
#: accounts/forms.py:77 #: accounts/forms.py:76
msgid "Public key already exist" msgid "Public key already exist"
msgstr "公钥已存在" msgstr "公钥已存在"
#: accounts/forms.py:80 #: accounts/forms.py:79
msgid "Invalid key" msgid "Invalid key"
msgstr "无效的密钥" msgstr "无效的密钥"
#: accounts/forms.py:96 computes/templates/computes/instances.html:45 #: accounts/forms.py:95 computes/templates/computes/instances.html:45
#: instances/templates/add_instance_volume.html:39 #: instances/templates/add_instance_volume.html:39
#: instances/templates/allinstances_index_grouped.html:11 #: instances/templates/allinstances_index_grouped.html:11
#: instances/templates/allinstances_index_nongrouped.html:6 #: instances/templates/allinstances_index_nongrouped.html:6
@ -73,27 +73,27 @@ msgstr "无效的密钥"
msgid "Name" msgid "Name"
msgstr "名称" msgstr "名称"
#: accounts/forms.py:96 #: accounts/forms.py:95
msgid "What uses it, such as a script or a host" msgid "What uses it, such as a script or a host"
msgstr "用途,例如某个脚本或主机" msgstr "用途,例如某个脚本或主机"
#: accounts/forms.py:98 accounts/templates/api_token_list.html:19 #: accounts/forms.py:97 accounts/templates/api_token_list.html:19
msgid "Expires" msgid "Expires"
msgstr "有效期" msgstr "有效期"
#: accounts/forms.py:99 #: accounts/forms.py:98
msgid "in 30 days" msgid "in 30 days"
msgstr "30 天后" msgstr "30 天后"
#: accounts/forms.py:99 #: accounts/forms.py:98
msgid "in 90 days" msgid "in 90 days"
msgstr "90 天后" msgstr "90 天后"
#: accounts/forms.py:99 #: accounts/forms.py:98
msgid "in a year" msgid "in a year"
msgstr "一年后" msgstr "一年后"
#: accounts/forms.py:99 accounts/templates/account.html:29 #: accounts/forms.py:98 accounts/templates/account.html:29
#: accounts/templates/api_token_list.html:19 #: accounts/templates/api_token_list.html:19
#: accounts/templates/api_token_list.html:20 accounts/templates/profile.html:25 #: accounts/templates/api_token_list.html:20 accounts/templates/profile.html:25
#: admin/templates/admin/user_form.html:21 #: admin/templates/admin/user_form.html:21
@ -103,7 +103,7 @@ msgstr "一年后"
msgid "never" msgid "never"
msgstr "永不" msgstr "永不"
#: accounts/forms.py:104 #: accounts/forms.py:103
msgid "Email" msgid "Email"
msgstr "邮箱" msgstr "邮箱"
@ -141,7 +141,7 @@ msgstr "最大内存(MiB)"
msgid "max disk size (GiB)" msgid "max disk size (GiB)"
msgstr "最大磁盘大小(GiB)" msgstr "最大磁盘大小(GiB)"
#: accounts/models.py:82 #: accounts/models.py:82 admin/forms.py:22
msgid "Can change password" msgid "Can change password"
msgstr "可修改密码" msgstr "可修改密码"
@ -159,13 +159,13 @@ msgid "User Profile"
msgstr "用户资料" msgstr "用户资料"
#: accounts/templates/account.html:17 accounts/templates/profile.html:18 #: accounts/templates/account.html:17 accounts/templates/profile.html:18
#: admin/forms.py:75 admin/templates/admin/user_list.html:24 #: admin/forms.py:89 admin/templates/admin/user_list.html:24
#: admin/templates/admin/user_list.html:30 #: admin/templates/admin/user_list.html:30
msgid "Superuser" msgid "Superuser"
msgstr "超级用户" msgstr "超级用户"
#: accounts/templates/account.html:19 accounts/templates/profile.html:20 #: accounts/templates/account.html:19 accounts/templates/profile.html:20
#: admin/forms.py:75 admin/templates/admin/user_list.html:24 #: admin/forms.py:89 admin/templates/admin/user_list.html:24
#: admin/templates/admin/user_list.html:32 #: admin/templates/admin/user_list.html:32
msgid "Template editor" msgid "Template editor"
msgstr "模板编辑者" msgstr "模板编辑者"
@ -209,7 +209,7 @@ msgid "User sections"
msgstr "用户页面导航" msgstr "用户页面导航"
#: accounts/templates/account.html:50 accounts/templates/account.html:58 #: accounts/templates/account.html:50 accounts/templates/account.html:58
#: admin/forms.py:193 computes/templates/computes/list.html:30 #: admin/forms.py:207 computes/templates/computes/list.html:30
#: computes/templates/computes/list.html:57 computes/templates/overview.html:46 #: computes/templates/computes/list.html:57 computes/templates/overview.html:46
msgid "VMs" msgid "VMs"
msgstr "虚拟机" msgstr "虚拟机"
@ -661,29 +661,45 @@ msgstr "未设置用户邮箱,无法发送二维码"
msgid "OTP of %(user)s was reset: a new QR code can be mailed." msgid "OTP of %(user)s was reset: a new QR code can be mailed."
msgstr "%(user)s 的 OTP 已重置:可以邮寄新的二维码。" msgstr "%(user)s 的 OTP 已重置:可以邮寄新的二维码。"
#: admin/forms.py:22 #: admin/forms.py:23
msgid "Can clone instances"
msgstr "可克隆虚拟机"
#: admin/forms.py:24 instances/models.py:436
msgid "Can access console without password"
msgstr "可无密码访问控制台"
#: admin/forms.py:25
msgid "Can snapshot instances"
msgstr "可为虚拟机创建快照"
#: admin/forms.py:26
msgid "Can view instances"
msgstr "可查看虚拟机"
#: admin/forms.py:31
msgid "Change their own password on their profile page" msgid "Change their own password on their profile page"
msgstr "在个人资料页修改自己的密码" msgstr "在个人资料页修改自己的密码"
#: admin/forms.py:23 #: admin/forms.py:32
msgid "" msgid ""
"Clone the VMs they may change and the templates they may view, within their " "Clone the VMs they may change and the templates they may view, within their "
"quota" "quota"
msgstr "在配额范围内克隆其可修改的虚拟机和可查看的模板" msgstr "在配额范围内克隆其可修改的虚拟机和可查看的模板"
#: admin/forms.py:24 #: admin/forms.py:33
msgid "Open a console without the VM's console password" msgid "Open a console without the VM's console password"
msgstr "无需虚拟机的控制台密码即可打开控制台" msgstr "无需虚拟机的控制台密码即可打开控制台"
#: admin/forms.py:25 #: admin/forms.py:34
msgid "Take, revert and delete snapshots of the VMs they may change" msgid "Take, revert and delete snapshots of the VMs they may change"
msgstr "为其可修改的虚拟机创建、恢复和删除快照" msgstr "为其可修改的虚拟机创建、恢复和删除快照"
#: admin/forms.py:26 #: admin/forms.py:35
msgid "See every VM and host in the lists, read-only" msgid "See every VM and host in the lists, read-only"
msgstr "在列表中查看所有虚拟机和主机(只读)" msgstr "在列表中查看所有虚拟机和主机(只读)"
#: admin/forms.py:75 admin/templates/admin/logs.html:39 #: admin/forms.py:89 admin/templates/admin/logs.html:39
#: admin/templates/admin/user_list.html:24 #: admin/templates/admin/user_list.html:24
#: admin/templates/admin/user_list.html:34 #: admin/templates/admin/user_list.html:34
#: computes/templates/computes/instances.html:46 #: computes/templates/computes/instances.html:46
@ -695,29 +711,29 @@ msgstr "在列表中查看所有虚拟机和主机(只读)"
msgid "User" msgid "User"
msgstr "用户" msgstr "用户"
#: admin/forms.py:82 admin/templates/admin/group_form.html:30 #: admin/forms.py:96 admin/templates/admin/group_form.html:30
msgid "Permissions" msgid "Permissions"
msgstr "权限" msgstr "权限"
#: admin/forms.py:89 admin/templates/admin/group_list.html:6 #: admin/forms.py:103 admin/templates/admin/group_list.html:6
#: admin/templates/admin/group_list.html:8 #: admin/templates/admin/group_list.html:8
#: admin/templates/admin/group_list.html:24 #: admin/templates/admin/group_list.html:24
#: admin/templates/admin/user_form.html:123 templates/navbar.html:33 #: admin/templates/admin/user_form.html:123 templates/navbar.html:33
msgid "Groups" msgid "Groups"
msgstr "用户组" msgstr "用户组"
#: admin/forms.py:143 #: admin/forms.py:157
#, python-format #, python-format
msgid "NEW_USER_DEFAULT_INSTANCES: %(name)s is not exactly one VM" msgid "NEW_USER_DEFAULT_INSTANCES: %(name)s is not exactly one VM"
msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 不是唯一的一台虚拟机" msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 不是唯一的一台虚拟机"
#: admin/forms.py:146 #: admin/forms.py:160
#, python-format #, python-format
msgid "" msgid ""
"NEW_USER_DEFAULT_INSTANCES: %(name)s has an owner, and only one is allowed" "NEW_USER_DEFAULT_INSTANCES: %(name)s has an owner, and only one is allowed"
msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 已有所有者,且只允许一个所有者" msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 已有所有者,且只允许一个所有者"
#: admin/forms.py:194 computes/templates/computes/list.html:58 #: admin/forms.py:208 computes/templates/computes/list.html:58
#: computes/templates/overview.html:58 instances/forms.py:14 #: computes/templates/overview.html:58 instances/forms.py:14
#: instances/templates/allinstances_index_grouped.html:16 #: instances/templates/allinstances_index_grouped.html:16
#: instances/templates/allinstances_index_nongrouped.html:14 #: instances/templates/allinstances_index_nongrouped.html:14
@ -727,7 +743,7 @@ msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 已有所有者,且只允许一
msgid "vCPUs" msgid "vCPUs"
msgstr "vCPU" msgstr "vCPU"
#: admin/forms.py:195 computes/templates/computes/instances.html:49 #: admin/forms.py:209 computes/templates/computes/instances.html:49
#: computes/templates/computes/list.html:59 computes/templates/overview.html:66 #: computes/templates/computes/list.html:59 computes/templates/overview.html:66
#: computes/templates/overview.html:150 #: computes/templates/overview.html:150
#: instances/templates/allinstances_index_grouped.html:17 #: instances/templates/allinstances_index_grouped.html:17
@ -739,34 +755,34 @@ msgstr "vCPU"
msgid "Memory" msgid "Memory"
msgstr "内存" msgstr "内存"
#: admin/forms.py:196 instances/models.py:240 #: admin/forms.py:210 instances/models.py:240
#: instances/templates/create_instance_w2.html:118 #: instances/templates/create_instance_w2.html:118
#: instances/templates/instances/settings_tab.html:25 #: instances/templates/instances/settings_tab.html:25
#: instances/templates/instances/stats_tab.html:53 #: instances/templates/instances/stats_tab.html:53
msgid "Disk" msgid "Disk"
msgstr "磁盘" msgstr "磁盘"
#: admin/forms.py:206 #: admin/forms.py:220
msgid "No limit" msgid "No limit"
msgstr "不限" msgstr "不限"
#: admin/forms.py:222 #: admin/forms.py:236
msgid "Enter a limit or choose No limit." msgid "Enter a limit or choose No limit."
msgstr "请输入限制值,或选择“不限”。" msgstr "请输入限制值,或选择“不限”。"
#: admin/forms.py:234 #: admin/forms.py:248
msgid "The user must change it at their next login" msgid "The user must change it at their next login"
msgstr "用户必须在下次登录时修改密码" msgstr "用户必须在下次登录时修改密码"
#: admin/forms.py:240 #: admin/forms.py:254
msgid "With a password" msgid "With a password"
msgstr "使用密码" msgstr "使用密码"
#: admin/forms.py:240 #: admin/forms.py:254
msgid "Without a password" msgid "Without a password"
msgstr "不使用密码" msgstr "不使用密码"
#: admin/forms.py:246 #: admin/forms.py:260
msgid "A user without a password cannot be made to change it" msgid "A user without a password cannot be made to change it"
msgstr "没有密码的用户无法被要求修改密码" msgstr "没有密码的用户无法被要求修改密码"
@ -3209,10 +3225,6 @@ msgstr "CD-ROM"
msgid "NIC" msgid "NIC"
msgstr "网卡" msgstr "网卡"
#: instances/models.py:436
msgid "Can access console without password"
msgstr "可无密码访问控制台"
#: instances/states.py:10 #: instances/states.py:10
msgid "No state" msgid "No state"
msgstr "无状态" msgstr "无状态"