Commit a6c27803 by Czémán Arnold

dashboard: fix toggle boot menu form permission problems, remove unecessary…

dashboard: fix toggle boot menu form permission problems, remove unecessary helper from ToggleBootMenuForm
parent 5b503e39
Pipeline #208 passed with stage
in 0 seconds
......@@ -1446,14 +1446,6 @@ class ToggleBootMenuForm(forms.ModelForm):
if disabled:
self.fields['boot_menu'].widget.attrs['disabled'] = 'disabled'
@property
def helper(self):
helper = FormHelper()
helper.form_action = (
reverse_lazy("dashboard.instance.op.toggle_boot_menu",
kwargs={'pk': self.instance.pk}))
return helper
class GroupPermissionForm(forms.ModelForm):
permissions = forms.ModelMultipleChoiceField(
......
......@@ -175,9 +175,9 @@ class VmDetailView(GraphMixin, CheckedDetailView):
context['traits_form'] = TraitsForm(instance=instance)
context['raw_data_form'] = RawDataForm(instance=instance)
context['toggle_boot_menu_form'] = ToggleBootMenuForm(
instance=instance,
disabled=hasattr(
if is_owner and user.has_perm("vm.toggle_boot_menu"):
context['toggle_boot_menu_form'] = ToggleBootMenuForm(
instance=instance, disabled=hasattr(
context['op']['toggle_boot_menu'], 'disabled'))
# resources change perm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment