mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 07:23:46 +00:00
Merge branch 'fix_buster' into 'dev'
Fix buster See merge request federez/re2o!437
This commit is contained in:
commit
9c1ca89b9d
3 changed files with 5 additions and 5 deletions
|
@ -76,7 +76,7 @@ class AllViewsRouter(DefaultRouter):
|
||||||
"""
|
"""
|
||||||
return pattern.split('/')[-1]
|
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.
|
"""Create a class-based view to use as the API root.
|
||||||
|
|
||||||
Highly inspired by the base class. See details on the implementation
|
Highly inspired by the base class. See details on the implementation
|
||||||
|
|
|
@ -521,7 +521,7 @@ def history(request, application, object_name, object_id):
|
||||||
'users:profil',
|
'users:profil',
|
||||||
kwargs={'userid': str(request.user.id)}
|
kwargs={'userid': str(request.user.id)}
|
||||||
))
|
))
|
||||||
can, msg = instance.can_view(request.user)
|
can, msg, _permissions = instance.can_view(request.user)
|
||||||
if not can:
|
if not can:
|
||||||
messages.error(request, msg or _("You don't have the right to access this menu."))
|
messages.error(request, msg or _("You don't have the right to access this menu."))
|
||||||
return redirect(reverse(
|
return redirect(reverse(
|
||||||
|
|
|
@ -104,7 +104,7 @@ class EditInterfaceForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
||||||
self.fields['ipv4'].queryset = IpList.objects.filter(
|
self.fields['ipv4'].queryset = IpList.objects.filter(
|
||||||
interface__isnull=True
|
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:
|
if not can_use_all_iptype:
|
||||||
self.fields['ipv4'].queryset = IpList.objects.filter(
|
self.fields['ipv4'].queryset = IpList.objects.filter(
|
||||||
interface__isnull=True
|
interface__isnull=True
|
||||||
|
@ -120,7 +120,7 @@ class EditInterfaceForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
||||||
if "machine" in self.fields:
|
if "machine" in self.fields:
|
||||||
self.fields['machine'].queryset = Machine.objects.all() \
|
self.fields['machine'].queryset = Machine.objects.all() \
|
||||||
.select_related('user')
|
.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:
|
if not can_use_all_machinetype:
|
||||||
self.fields['machine_type'].queryset = MachineType.objects.filter(
|
self.fields['machine_type'].queryset = MachineType.objects.filter(
|
||||||
ip_type__in=IpType.objects.filter(need_infra=False)
|
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__)
|
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
|
||||||
user = kwargs.pop('user')
|
user = kwargs.pop('user')
|
||||||
super(AliasForm, self).__init__(*args, prefix=prefix, **kwargs)
|
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:
|
if not can_use_all:
|
||||||
self.fields['extension'].queryset = Extension.objects.filter(
|
self.fields['extension'].queryset = Extension.objects.filter(
|
||||||
need_infra=False
|
need_infra=False
|
||||||
|
|
Loading…
Reference in a new issue