commit 359d1e04b119bdfae468e0813943a203258785a9
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu Oct 8 09:50:04 2015 +0200
Comment on bugzilla when a request.package is approved or denied
Fixes
https://github.com/fedora-infra/pkgdb2/issues/237
pkgdb2client/admin.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py
index e9d3672..45a385e 100644
--- a/pkgdb2client/admin.py
+++ b/pkgdb2client/admin.py
@@ -262,6 +262,8 @@ def __handle_request_package(actionid, action):
msgs = utils.check_package_creation(
action['info'], bugid, PKGDBCLIENT)
+ bugid = utils.get_bug_id_from_url(action['info']['pkg_review_url'])
+
decision = _ask_what_to_do(msgs)
if decision in ('a', 'approve'):
data = PKGDBCLIENT.create_package(
@@ -285,6 +287,12 @@ def __handle_request_package(actionid, action):
}
)
+ url = PKGDBCLIENT.url + '/package/' +
action['info']['pkg_name']
+ utils.comment_on_bug(
+ bugid,
+ 'Package request has been approved: %s' % url
+ )
+
elif decision in ('deny', 'd'):
message = raw_input(
'Could you explain why you declined this request? (this message '
@@ -298,6 +306,11 @@ def __handle_request_package(actionid, action):
}
)
+ utils.comment_on_bug(
+ bugid,
+ 'Package request has been denied with the reason: %s' % message
+ )
+
else:
data = {
'messages': ['Action {0} un-touched'.format(actionid)]