only log if theres emails to be processed

This commit is contained in:
Stephan Telling 2017-05-21 16:48:06 +02:00
parent 95e363b831
commit f986617c64
No known key found for this signature in database
GPG key ID: D4892289F36ADA9B

View file

@ -12,7 +12,11 @@ def do_work():
"""
not_processed_email = OutgoingEmail.objects.filter(processed=False)
logger.debug('about to process {} emails'.format(len(not_processed_email)))
if len(not_processed_email) > 0:
logger.debug('about to process {} emails'.format(
len(not_processed_email))
)
for email in not_processed_email:
if ',' in email.recipient:
recipient = email.recipient.split(',')