# some basic sanity checks
if 'From' not in mail:
LOGGER.debug("Ignoring patch due to missing 'From'")
- return 0
+ return 1
if 'Subject' not in mail:
LOGGER.debug("Ignoring patch due to missing 'Subject'")
- return 0
+ return 1
if 'Message-Id' not in mail:
LOGGER.debug("Ignoring patch due to missing 'Message-Id'")
- return 0
+ return 1
hint = mail.get('X-Patchwork-Hint', '').lower()
if hint == 'ignore':
if project is None:
LOGGER.error('Failed to find a project for patch')
- return 0
+ return 1
msgid = mail.get('Message-Id').strip()
patch.delegate = get_delegate(
mail.get('X-Patchwork-Delegate', '').strip())
patch.save()
+ LOGGER.debug('Patch saved')
if comment:
if save_required:
comment.submitter = author
comment.msgid = msgid
comment.save()
+ LOGGER.debug('Comment saved')
return 0