]> git.decadent.org.uk Git - dak.git/commitdiff
Remove some useless session.flush() calls.
authorTorsten Werner <twerner@debian.org>
Sat, 22 Jan 2011 12:49:29 +0000 (13:49 +0100)
committerTorsten Werner <twerner@debian.org>
Sat, 22 Jan 2011 12:49:50 +0000 (13:49 +0100)
We are using sqlalchemy's autoflush mode.

Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/dbconn.py

index 611b30a05e2fa3c922bc83926e2f9dbe723c105e..9c1ed2b39b677d0f1d85f21d19c89a1d57b95c96 100755 (executable)
@@ -2266,12 +2266,10 @@ def add_dsc_to_db(u, filename, session=None):
 
     source.poolfile_id = entry["files id"]
     session.add(source)
-    session.flush()
 
     suite_names = u.pkg.changes["distribution"].keys()
     source.suites = session.query(Suite). \
         filter(Suite.suite_name.in_(suite_names)).all()
-    session.flush()
 
     # Add the source files to the DB (files and dsc_files)
     dscfile = DSCFile()
@@ -2321,8 +2319,6 @@ def add_dsc_to_db(u, filename, session=None):
         df.poolfile_id = files_id
         session.add(df)
 
-    session.flush()
-
     # Add the src_uploaders to the DB
     uploader_ids = [source.maintainer_id]
     if u.pkg.dsc.has_key("uploaders"):