aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-10-05 19:52:45 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-10-05 19:52:45 -0400
commit43b147ab65df7869f4dc91f2193ca91592ff4532 (patch)
tree6e555fdf703481f13011a5d99c8b3a0e7ee98cf3
parenta14aa628e0f06a634ff4e431750f93b79134be1d (diff)
downloadkorg-helpers-43b147ab65df7869f4dc91f2193ca91592ff4532.tar.gz
Only add cc's if we're not doing "onlyto"
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgit-patchwork-bot.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py
index fa036fb..b357c1b 100755
--- a/git-patchwork-bot.py
+++ b/git-patchwork-bot.py
@@ -751,16 +751,6 @@ def notify_submitters(serieslist, refname, revs, pname, rs, hs):
msg['References'] = Header(reference)
msg['In-Reply-To'] = Header(reference)
- ccaddrs = list()
- if tweaks.get('alwayscc'):
- ccaddrs += listify(tweaks['alwayscc'])
- if tweaks.get('cclist'):
- ccaddrs.append(project.get('list_email'))
- if tweaks.get('ccall'):
- for addr in tos + ccs:
- if addr not in ccaddrs:
- ccaddrs.append(addr)
-
if 'onlyto' in tweaks:
targets = listify(tweaks['onlyto'])
msg['To'] = '%s <%s>' % (submitter.get('name'), targets[0])
@@ -768,12 +758,24 @@ def notify_submitters(serieslist, refname, revs, pname, rs, hs):
targets = [submitter.get('email')]
msg['To'] = Header('%s <%s>' % (submitter.get('name'), submitter.get('email')))
- targets += ccaddrs
- if 'alwaysbcc' in tweaks:
- targets += listify(tweaks['alwaysbcc'])
-
- if len(ccaddrs):
- msg['Cc'] = ', '.join(ccaddrs)
+ ccaddrs = list()
+ if tweaks.get('alwayscc'):
+ ccaddrs += listify(tweaks['alwayscc'])
+ targets += ccaddrs
+ if tweaks.get('cclist'):
+ ccaddrs.append(project.get('list_email'))
+ targets.append(project.get('list_email'))
+ if tweaks.get('ccall'):
+ for addr in tos + ccs:
+ if addr not in targets:
+ targets.append(addr)
+ ccaddrs.append(addr)
+
+ if 'alwaysbcc' in tweaks:
+ targets += listify(tweaks['alwaysbcc'])
+
+ if len(ccaddrs):
+ msg['Cc'] = ', '.join(ccaddrs)
if not NOMAIL:
logger.debug('Message follows')