Use session.commit() instead of session.flush() to avoid IntegrityError
Merge branch 'master' of github.com:relip/depot