X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=30d1d7d677817e06e1a39a0436f286f0230c707f;hb=0750ad113069a06ea7e710cf6bc21b0a2314a4a5;hp=4669cfc891efec4f9c0dd5eccaf91aaf84260321;hpb=45a8e97726dc50a1be3d9e24d9fc0752a91834ac;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 4669cfc8..30d1d7d6 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -1095,6 +1095,30 @@ def get_or_set_maintainer(name, session=None): __all__.append('get_or_set_maintainer') +def get_maintainer(maintainer_id, session=None): + """ + Return the name of the maintainer behind C{maintainer_id}. + + @type maintainer_id: int + @param maintainer_id: the id of the maintainer + + @rtype: string + @return: the name of the maintainer + """ + + privatetrans = False + if session is None: + session = DBConn().session() + privatetrans = True + + try: + return session.query(Maintainer).get(maintainer_id).name + finally: + if privatetrans: + session.close() + +__all__.append('get_maintainer') + ################################################################################ class NewComment(object): @@ -1579,7 +1603,7 @@ class Queue(object): # If it does, update things to ensure it's not removed prematurely else: - qb = get_queue_build(dest, suite_id, session) + qb = get_queue_build(dest, s.suite_id, session) if qb is None: qb.in_queue = True qb.last_used = None