Commit db3d9cb4 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Fix bug

parent d6b488de
......@@ -154,6 +154,10 @@ class NsForm(ModelForm):
model = Ns
fields = ['zone', 'ns']
def __init__(self, *args, **kwargs):
super(NsForm, self).__init__(*args, **kwargs)
self.fields['ns'].queryset = Domain.objects.exclude(interface_parent=None)
class DelNsForm(ModelForm):
ns = forms.ModelMultipleChoiceField(queryset=Ns.objects.all(), label="Enregistrements NS actuels", widget=forms.CheckboxSelectMultiple)
......
......@@ -55,7 +55,7 @@ def search_result(search, type, request):
if i == '0':
recherche['users_list'] = User.objects.filter((Q(room__name__icontains = search) | Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) & query1).order_by('state', 'surname')
if i == '1':
data = Interface.objects.filter(Q(machine__user__pseudo__icontains = search) | Q(machine__user__name__icontains = search) | Q(machine__user__surname__icontains = search) | Q(mac_address__icontains = search) | Q(ipv4__ipv4__icontains = search))
data = Interface.objects.filter(Q(machine__user__pseudo__icontains = search) | Q(machine__user__name__icontains = search) | Q(machine__user__surname__icontains = search) | Q(mac_address__icontains = search) | Q(ipv4__ipv4__icontains = search) | Q(domain__name__icontains = search) | Q(domain__related_domain__name__icontains = search))
for d in data:
recherche['machines_list'].append(d.machine)
if i == '2':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment