8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-29 02:13:46 +00:00

Récupère les associations machine_type->ip pour le template

This commit is contained in:
Maël Kervella 2017-10-02 23:53:55 +00:00 committed by Pierre Cadart
parent 2d14e1f1b5
commit cd8d600ada

View file

@ -117,7 +117,10 @@ def new_machine(request, userid):
reversion.set_comment("Création")
messages.success(request, "La machine a été créée")
return redirect("/users/profil/" + str(user.id))
return form({'machineform': machine, 'interfaceform': interface, 'domainform': domain}, 'machines/machine.html', request)
type_to_ipv4 = {}
for t in interface.fields['type'].queryset :
type_to_ipv4[str(t.id)] = IpList.objects.filter(interface__isnull=True).filter(ip_type=t.ip_type)
return form({'machineform': machine, 'interfaceform': interface, 'domainform': domain, 'type_to_ipv4': type_to_ipv4}, 'machines/machine.html', request)
@login_required
def edit_interface(request, interfaceid):