Commit cdb4d733 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by nanoy

Fix conflicting variable names (ns vs nss)

parent b896799a
Pipeline #2360 passed with stage
in 3 minutes and 24 seconds
......@@ -400,7 +400,7 @@ class NsForm(FormRevMixin, ModelForm):
class DelNsForm(FormRevMixin, Form):
"""Suppresion d'un ou plusieurs NS"""
ns = forms.ModelMultipleChoiceField(
nss = forms.ModelMultipleChoiceField(
label=_("Current NS records"),
......@@ -410,9 +410,9 @@ class DelNsForm(FormRevMixin, Form):
instances = kwargs.pop("instances", None)
super(DelNsForm, self).__init__(*args, **kwargs)
if instances:
self.fields["ns"].queryset = instances
self.fields["nss"].queryset = instances
self.fields["ns"].queryset = Ns.objects.all()
self.fields["nss"].queryset = Ns.objects.all()
class TxtForm(FormRevMixin, ModelForm):
......@@ -817,9 +817,9 @@ def edit_ns(request, ns_instance, **_kwargs):
def del_ns(request, instances):
""" View used to delete a NS object """
ns = DelNsForm(request.POST or None, instances=instances)
if ns.is_valid():
ns_dels = ns.cleaned_data["ns"]
nss = DelNsForm(request.POST or None, instances=instances)
if nss.is_valid():
ns_dels = nss.cleaned_data["nss"]
for ns_del in ns_dels:
......@@ -830,7 +830,7 @@ def del_ns(request, instances):
return redirect(reverse("machines:index-extension"))
return form(
{"nsform": ns, "action_name": _("Delete")}, "machines/machine.html", request
{"nsform": nss, "action_name": _("Delete")}, "machines/machine.html", request
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