~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/userservice/__init__.py

  • Committer: wagrant
  • Date: 2008-08-10 13:24:15 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1011
userservice: Don't wrap group membership creation in a transaction, or
             the last added user won't be able to access the repo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
797
797
        req.throw_error(req.HTTP_BAD_REQUEST, repr(e))
798
798
 
799
799
    # Add assignment to database
800
 
    # Start transaction since things can go wrong
801
 
    db.start_transaction()
 
800
    # We can't use a transaction here, as usrmgt-server needs to see the
 
801
    # changes!
802
802
    try:
803
803
        dbquery = db.insert(
804
804
            {
821
821
            if 'response' not in usrmgt or usrmgt['response']=='failure':
822
822
                req.throw_error(req.HTTP_INTERNAL_SERVER_ERROR,
823
823
                    "Failure creating repository: %s"%str(usrmgt))
824
 
 
825
 
        # Everything went OK. Lock it into the database
826
 
        db.commit()
827
 
 
828
824
    except Exception, e:
829
 
        db.rollback()
830
825
        req.throw_error(req.HTTP_INTERNAL_SERVER_ERROR, repr(e))
831
826
    finally:
832
827
        db.close()