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
...@@ -1446,14 +1446,6 @@ class ToggleBootMenuForm(forms.ModelForm): ...@@ -1446,14 +1446,6 @@ class ToggleBootMenuForm(forms.ModelForm):
if disabled: if disabled:
self.fields['boot_menu'].widget.attrs['disabled'] = '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): class GroupPermissionForm(forms.ModelForm):
permissions = forms.ModelMultipleChoiceField( permissions = forms.ModelMultipleChoiceField(
......
...@@ -175,9 +175,9 @@ class VmDetailView(GraphMixin, CheckedDetailView): ...@@ -175,9 +175,9 @@ class VmDetailView(GraphMixin, CheckedDetailView):
context['traits_form'] = TraitsForm(instance=instance) context['traits_form'] = TraitsForm(instance=instance)
context['raw_data_form'] = RawDataForm(instance=instance) context['raw_data_form'] = RawDataForm(instance=instance)
context['toggle_boot_menu_form'] = ToggleBootMenuForm( if is_owner and user.has_perm("vm.toggle_boot_menu"):
instance=instance, context['toggle_boot_menu_form'] = ToggleBootMenuForm(
disabled=hasattr( instance=instance, disabled=hasattr(
context['op']['toggle_boot_menu'], 'disabled')) context['op']['toggle_boot_menu'], 'disabled'))
# resources change perm # 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