diff --git a/api/routers.py b/api/routers.py index 7c9e4a0f..bb2411f5 100644 --- a/api/routers.py +++ b/api/routers.py @@ -76,7 +76,7 @@ class AllViewsRouter(DefaultRouter): """ return pattern.split('/')[-1] - def get_api_root_view(self, schema_urls=None): + def get_api_root_view(self, schema_urls=None, api_urls=None): """Create a class-based view to use as the API root. Highly inspired by the base class. See details on the implementation diff --git a/logs/views.py b/logs/views.py index 28205063..47ceab06 100644 --- a/logs/views.py +++ b/logs/views.py @@ -521,7 +521,7 @@ def history(request, application, object_name, object_id): 'users:profil', kwargs={'userid': str(request.user.id)} )) - can, msg = instance.can_view(request.user) + can, msg, _permissions = instance.can_view(request.user) if not can: messages.error(request, msg or _("You don't have the right to access this menu.")) return redirect(reverse( diff --git a/machines/forms.py b/machines/forms.py index af05a48e..4ea2323b 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, _permissions = 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, _permissions = 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, _permissions = Extension.can_use_all(user) if not can_use_all: self.fields['extension'].queryset = Extension.objects.filter( need_infra=False