diff --git a/progit/lib.py b/progit/lib.py index 4624393..16fab5e 100644 --- a/progit/lib.py +++ b/progit/lib.py @@ -748,10 +748,13 @@ def close_pull_request(session, request, user, merged=True): session.add(request) session.flush() + globalid = get_pull_request_global_id( + session, request.project.id, request.id) + if merged == True: - progit.notify.notify_merge_pull_request(request, user) + progit.notify.notify_merge_pull_request(request, user, globalid) else: - progit.notify.notify_cancelled_pull_request(request, user) + progit.notify.notify_cancelled_pull_request(request, user, globalid) def get_issue_statuses(session): diff --git a/progit/notify.py b/progit/notify.py index d3a85cb..e43d295 100644 --- a/progit/notify.py +++ b/progit/notify.py @@ -165,7 +165,7 @@ New pull-request: ) -def notify_merge_pull_request(request, user): +def notify_merge_pull_request(request, user, globalid): ''' Notify the people following a project that a pull-request was merged in it. ''' @@ -186,7 +186,7 @@ Merged pull-request: '%s/%s/request-pull/%s' % ( progit.APP.config['APP_URL'], request.repo.name, - request.id, + globalid, ), ) mail_to = set([cmt.user.emails[0].email for cmt in request.comments]) @@ -203,7 +203,7 @@ Merged pull-request: ) -def notify_cancelled_pull_request(request, user): +def notify_cancelled_pull_request(request, user, globalid): ''' Notify the people following a project that a pull-request was cancelled in it. ''' @@ -224,7 +224,7 @@ Cancelled pull-request: '%s/%s/request-pull/%s' % ( progit.APP.config['APP_URL'], request.repo.name, - request.id, + globalid, ), ) mail_to = set([cmt.user.emails[0].email for cmt in request.comments])