Skip to content

Commit

Permalink
Make sure the patch subject isn't None
Browse files Browse the repository at this point in the history
Add fail object to 'get()' call, simplifying the subject handling.

Signed-off-by: Veronika Kabatova <[email protected]>
  • Loading branch information
veruu authored and major committed Aug 24, 2018
1 parent 5262b88 commit 01b7bd1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sktm/patchwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,8 @@ def __update_patch_name(self, patch):
if 'root_comment' in patch:
# internal RH only: rewrite the original subject line
msg = email.message_from_string(patch['root_comment']['headers'])
subject = msg.get('Subject')
if subject is not None:
subject = subject.replace('\n\t', ' ').replace('\n', ' ')
# TODO What happens when subject is None?
subject = msg.get('Subject', '')
subject = subject.replace('\n\t', ' ').replace('\n', ' ')
patch['name'] = stringify(
email.header.decode_header(subject)[0][0]
)
Expand Down

0 comments on commit 01b7bd1

Please sign in to comment.