8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-28 01:43:46 +00:00

Merge branch 'fix_buster' into 'dev'

Fix buster

See merge request federez/re2o!437
This commit is contained in:
klafyvel 2019-09-19 23:16:56 +02:00
commit 9c1ca89b9d
3 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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(

View file

@ -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