Changeset 6509 for trunk


Ignore:
Timestamp:
Dec 29, 2008, 11:30:15 PM (16 years ago)
Author:
roland
Message:

Last hand on forms.py.
Static host should be working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exodus/forms.py

    r6507 r6509  
    6969                        iplist = [show_addr(networkaddrL + k) for k in
    7070                                xrange(1, ip_size-1)]
    71                         import pdb; pdb.set_trace() ;
    7271                        for k in i.interface_set.all():
    7372                            iplist.remove(k.ip)
     
    288287                    i.netmask = netmask
    289288                    i.save()
     289                if link.accesspoint:
     290                    # Need to reverse because when i.save() happens
     291                    # the database might have an old ipaddress and unique==True
     292                    static = link.dhcpstatic_set.all()
     293                    for i in static.order_by('ipaddress').reverse():
     294                        i.ipaddress = new_ip.ips.pop()
     295                        i.save()
    290296                return ip
    291297
     
    313319                    i.netmask = netmask
    314320                    i.save()
     321                static = link.dhcpstatic_set.all()
     322                for i in static.order_by('ipaddress').reverse():
     323                    i.ipaddress = new_ip.ips.pop()
     324                    i.save()
    315325                return ip
    316326
Note: See TracChangeset for help on using the changeset viewer.