From 44f097c016df3beaf120f2f1a13e7f04695e5793 Mon Sep 17 00:00:00 2001 From: Veronika Kabatova Date: Tue, 15 May 2018 18:57:18 +0200 Subject: [PATCH] Fix inconsistency between interfaces with header retrieval Patchwork2 interface is fine, but Patchwork1 interface wasn't fixed orignally. Signed-off-by: Veronika Kabatova --- sktm/patchwork.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sktm/patchwork.py b/sktm/patchwork.py index 33388214..a5aec294 100644 --- a/sktm/patchwork.py +++ b/sktm/patchwork.py @@ -809,7 +809,7 @@ def get_header_value(self, patch_id, *keys): for key in keys: value = mbox_email.get_all(key, ['']) if len(value) == 1: - res += (header_value[0],) + res += (value[0],) else: res += ('\n\n'.join([val for val in value]),) @@ -830,7 +830,7 @@ def get_emails(self, pid): logging.debug("getting emails for patch %d from 'from', 'to', 'cc'") header_values = self.get_header_value(pid, "From", "To", "Cc") for header_value in header_values: - for faddr in [x.strip() for x in mbox[header].split(",") if x]: + for faddr in [x.strip() for x in header_value.split(",") if x]: logging.debug("patch=%d; email=%s", pid, faddr) maddr = re.search(r"\<([^\>]+)\>", faddr) if maddr: