Ignore:
Timestamp:
Oct 3, 2008, 7:26:43 PM (16 years ago)
Author:
broder
Message:

Update web code to for SQLAlchemy 0.4

File:
1 edited

Legend:

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

    r879 r1013  
    4646    for removed in old_people - people:
    4747        ma = [x for x in m.acl if x.user == removed][0]
    48         ctx.current.delete(ma)
     48        session.delete(ma)
    4949    for p in people - old_people:
    5050        ma = MachineAccess(user=p)
    5151        m.acl.append(ma)
    52         ctx.current.save(ma)
     52        session.save_or_update(ma)
    5353   
    5454def refreshCache():
    55     transaction = ctx.current.create_transaction()
     55    session.begin()
    5656
    5757    try:
     
    5959        for m in machines:
    6060            refreshMachine(m)
    61         ctx.current.flush()
     61        session.flush()
    6262           
    6363        # Atomically execute our changes
    64         transaction.commit()
     64        session.commit()
    6565    except:
    6666        # Failed! Rollback all the changes.
    67         transaction.rollback()
     67        session.rollback()
    6868        raise
    6969
Note: See TracChangeset for help on using the changeset viewer.