From 7fb5f786fdffca076cdf3c178516520713df337d Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 17 Sep 2019 18:41:41 +0200 Subject: [PATCH] Fix list usable machine by rights --- machines/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/machines/forms.py b/machines/forms.py index af05a48e..c89334dd 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -104,7 +104,7 @@ class EditInterfaceForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): self.fields['ipv4'].queryset = IpList.objects.filter( interface__isnull=True ) - can_use_all_iptype, _reason = IpType.can_use_all(user) + can_use_all_iptype, _reason, _message = IpType.can_use_all(user) if not can_use_all_iptype: self.fields['ipv4'].queryset = IpList.objects.filter( interface__isnull=True @@ -120,7 +120,7 @@ class EditInterfaceForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): if "machine" in self.fields: self.fields['machine'].queryset = Machine.objects.all() \ .select_related('user') - can_use_all_machinetype, _reason = MachineType.can_use_all(user) + can_use_all_machinetype, _reason, _message = MachineType.can_use_all(user) if not can_use_all_machinetype: self.fields['machine_type'].queryset = MachineType.objects.filter( ip_type__in=IpType.objects.filter(need_infra=False) @@ -146,7 +146,7 @@ class AliasForm(FormRevMixin, ModelForm): prefix = kwargs.pop('prefix', self.Meta.model.__name__) user = kwargs.pop('user') super(AliasForm, self).__init__(*args, prefix=prefix, **kwargs) - can_use_all, _reason = Extension.can_use_all(user) + can_use_all, _reason, _message = Extension.can_use_all(user) if not can_use_all: self.fields['extension'].queryset = Extension.objects.filter( need_infra=False