8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 01:16:27 +00:00

Better naming

This commit is contained in:
klafyvel 2019-09-19 23:16:02 +02:00
parent 1c2ce26060
commit 4f1102c0c5

View file

@ -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, _message = 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, _message = 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