mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-02 17:42:26 +00:00
Optimisation
This commit is contained in:
parent
56d62a96bf
commit
b3c97a0680
1 changed files with 9 additions and 9 deletions
|
@ -725,13 +725,13 @@ class JSONResponse(HttpResponse):
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('serveur')
|
@permission_required('serveur')
|
||||||
def interface_list(request):
|
def mac_ip_list(request):
|
||||||
interfaces = Interface.objects.all()
|
interfaces = Interface.objects.select_related('ipv4').select_related('domain').all()
|
||||||
interface = []
|
filter(
|
||||||
for i in interfaces :
|
lambda interface: interface.ipv4 and interface.is_active(),
|
||||||
if i.ipv4 and i.is_active():
|
interfaces
|
||||||
interface.append(i)
|
)
|
||||||
seria = InterfaceSerializer(interface, many=True)
|
seria = InterfaceSerializer(interfaces, many=True)
|
||||||
return seria.data
|
return seria.data
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
|
@ -778,14 +778,14 @@ def zones(request):
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('serveur')
|
@permission_required('serveur')
|
||||||
def mac_ip(request):
|
def mac_ip(request):
|
||||||
seria = interface_list(request)
|
seria = mac_ip_list(request)
|
||||||
return JSONResponse(seria)
|
return JSONResponse(seria)
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required('serveur')
|
@permission_required('serveur')
|
||||||
def mac_ip_dns(request):
|
def mac_ip_dns(request):
|
||||||
seria = interface_list(request)
|
seria = mac_ip_list(request)
|
||||||
return JSONResponse(seria)
|
return JSONResponse(seria)
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
|
|
Loading…
Reference in a new issue