summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2016-04-06 15:45:27 +0000
committerMagnus Hagander2016-04-06 15:45:27 +0000
commitc55fcebc51aed3633e1a02151e5161d9e0a85e59 (patch)
tree770a215929e526f3eadf847d3652740173c6f8d5
parent0b2695dc4760a4a03571321ac784f00780a09263 (diff)
CC authors of patches on comments and reviews
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
-rw-r--r--pgcommitfest/commitfest/views.py6
1 files changed, 6 insertions, 0 deletions
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