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

Optimisation sur la methode qui renvoie les interfaces d'un user

parent 9e0ab9df
......@@ -378,7 +378,7 @@ class User(AbstractBaseUser):
def user_interfaces(self, active=True):
""" Renvoie toutes les interfaces dont les machines appartiennent à self
Par defaut ne prend que les interfaces actives"""
return Interface.objects.filter(machine__in=Machine.objects.filter(user=self, active=active))
return Interface.objects.filter(machine__in=Machine.objects.filter(user=self, active=active)).select_related('domain__extension')
def assign_ips(self):
""" Assign une ipv4 aux machines d'un user """
......
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