X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=361dcf42cfc3b1eaad30d1f3dbc72785678e8c02;hb=116c586ae4d3ec69279bc0b8ef983348485793e2;hp=210c43aeee5b749f574cf9291cba116762656279;hpb=3c079bd6c6fe242f1535f90fd10e49548373cbef;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 210c43ae..361dcf42 100644 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -450,7 +450,7 @@ class BuildQueue(object): # In this case, update the BuildQueueFile entry so we # don't remove it too early f.lastused = datetime.now() - DBConn().session().object_session(pf).add(f) + DBConn().session().object_session(poolfile).add(f) return f # Prepare BuildQueueFile object @@ -2062,6 +2062,11 @@ def add_dsc_to_db(u, filename, session=None): poolfile = add_poolfile(filename, dentry, dsc_location_id, session) pfs.append(poolfile) files_id = poolfile.file_id + else: + poolfile = get_poolfile_by_id(files_id, session) + if poolfile is None: + utils.fubar("INTERNAL ERROR. Found no poolfile with id %d" % files_id) + pfs.append(poolfile) df.poolfile_id = files_id session.add(df)