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

Repasse sur l'ancienne utilisation de l'objet extension

parent 85703c40
......@@ -243,7 +243,7 @@ class Domain(models.Model):
super(Domain, self).save(*args, **kwargs)
def __str__(self):
return str(self.name) + str(self.get_extension())
return str(self.name) + str(self.extension)
class IpList(models.Model):
PRETTY_NAME = "Addresses ipv4"
......@@ -300,4 +300,3 @@ def machine_post_save(sender, **kwargs):
machinetype = kwargs['instance']
for interface in machinetype.all_interfaces():
interface.update_type()
......@@ -50,7 +50,7 @@ class InterfaceSerializer(serializers.ModelSerializer):
return obj.domain.name
def get_interface_extension(self, obj):
return obj.domain.get_extension().name
return obj.domain.extension.name
def get_macaddress(self, obj):
return str(obj.mac_address)
......
......@@ -52,7 +52,7 @@ from preferences.models import GeneralOption, OptionalMachine
def all_active_interfaces():
"""Renvoie l'ensemble des machines autorisées à sortir sur internet """
return Interface.objects.filter(machine__in=Machine.objects.filter(user__in=all_has_access()).filter(active=True)).select_related('domain').select_related('machine').select_related('type').select_related('ipv4').select_related('type__ip_type__extension').select_related('ipv4__ip_type').distinct()
return Interface.objects.filter(machine__in=Machine.objects.filter(user__in=all_has_access()).filter(active=True)).select_related('domain').select_related('machine').select_related('type').select_related('ipv4').select_related('domain_extension').select_related('ipv4__ip_type').distinct()
def all_active_assigned_interfaces():
""" Renvoie l'ensemble des machines qui ont une ipv4 assignées et disposant de l'accès internet"""
......
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