Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fix inconsistency between interfaces with header retrieval
Browse files Browse the repository at this point in the history
Patchwork2 interface is fine, but Patchwork1 interface wasn't fixed
orignally.

Signed-off-by: Veronika Kabatova <[email protected]>
  • Loading branch information
veruu committed May 15, 2018
1 parent ed7a37a commit 44f097c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sktm/patchwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]),)

Expand All @@ -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:
Expand Down

0 comments on commit 44f097c

Please sign in to comment.