From c55fcebc51aed3633e1a02151e5161d9e0a85e59 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 6 Apr 2016 17:45:27 +0200 Subject: [PATCH] CC authors of patches on comments and reviews MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This adds the Cc field when using the Review or the Comment function on the website, and will add a list of all listed authors of the patch to this. Should help people highlight it in their inboxes. Suggested by José Luis Tallón --- pgcommitfest/commitfest/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index a6aee9c..5fda5b2 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -366,6 +366,12 @@ def comment(request, cfid, patchid, what): msg['To'] = settings.HACKERS_EMAIL msg['From'] = "%s %s <%s>" % (request.user.first_name, request.user.last_name, UserWrapper(request.user).email) + + # CC the authors of a patch, if there are any + authors = list(patch.authors.all()) + if len(authors): + msg['Cc'] = ", ".join(["%s %s <%s>" % (a.first_name, a.last_name, UserWrapper(a).email) for a in authors]) + msg['Date'] = formatdate(localtime=True) msg['User-Agent'] = 'pgcommitfest' msg['X-cfsender'] = request.user.username -- 2.39.5