Changeset 446 for trunk


Ignore:
Timestamp:
Apr 22, 2008, 12:03:45 AM (17 years ago)
Author:
ecprice
Message:

Update cache for machines on their modification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/main.py

    r443 r446  
    4040from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall
    4141import validation
     42import cache_acls
    4243from webcommon import InvalidInput, CodeError, g
    4344import controls
     
    395396                ctx.current.save(disk)
    396397
    397         if owner is not None:
     398        update_acl = False
     399        if owner is not None and owner != machine.owner:
    398400            machine.owner = owner
     401            update_acl = True
    399402        if name is not None:
    400403            machine.name = name
    401         if admin is not None:
     404        if admin is not None and admin != machine.administrator:
    402405            machine.administrator = admin
     406            update_acl = True
    403407        if contact is not None:
    404408            machine.contact = contact
    405409
    406410        ctx.current.save(machine)
     411        if update_acl:
     412            cache_acls.refreshMachine(machine)
    407413        transaction.commit()
    408414    except:
Note: See TracChangeset for help on using the changeset viewer.