From eb17a681f9dba9f801b2ca58bbc2df38fecbd31a Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Aug 02 2018 11:05:41 +0000 Subject: [kojihub] add strict parameter in getBuildNotification --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 22dd484..a51d3e2 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -11015,15 +11015,17 @@ class RootExports(object): userID = user['id'] return get_build_notifications(userID) - def getBuildNotification(self, id): - """Get the build notification with the given ID. Return None - if there is no notification with the given ID.""" + def getBuildNotification(self, id, strict=False): + """Get the build notification with the given ID. + If there is no notification with the given ID, when strict is True, + raise GenericError, else return None. + """ fields = ('id', 'user_id', 'package_id', 'tag_id', 'success_only', 'email') query = """SELECT %s FROM build_notifications WHERE id = %%(id)i """ % ', '.join(fields) - return _singleRow(query, locals(), fields) + return _singleRow(query, locals(), fields, strict=strict) def updateNotification(self, id, package_id, tag_id, success_only): """Update an existing build notification with new data. If the notification