From fa613108a5e9b5d145c7b0b8cbba202eb83645e3 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Mar 04 2020 08:58:29 +0000 Subject: build_references: fix the type of event_id used by max fixes: #1961 --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 46db0c5..1015777 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -7939,7 +7939,7 @@ def build_references(build_id, limit=None, lazy=False): FROM buildroot_listing WHERE rpm_id IN %(rpm_ids)s )""" - event_id = _fetchSingle(q, {'rpm_ids': build_rpm_ids}) or 0 + event_id = (_fetchSingle(q, {'rpm_ids': build_rpm_ids}) or (0,))[0] or 0 if build_archive_ids: q = """SELECT MAX(create_event) FROM standard_buildroot @@ -7948,7 +7948,7 @@ def build_references(build_id, limit=None, lazy=False): FROM buildroot_archives WHERE archive_id IN %(archive_ids)s )""" - event_id2 = _fetchSingle(q, {'archive_ids': build_archive_ids}) or 0 + event_id2 = (_fetchSingle(q, {'archive_ids': build_archive_ids}) or (0,))[0] or 0 event_id = max(event_id, event_id2) if event_id: q = """SELECT EXTRACT(EPOCH FROM get_event_time(%(event_id)i))"""