Merge pull request #1817 from AlanCoding/notification_fail

Do not fail entire notification chain if one fails
This commit is contained in:
Alan Rominger 2018-05-17 10:06:03 -04:00 committed by GitHub
commit 14d10a93cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,7 +255,10 @@ def send_notifications(notification_list, job_id=None):
notification.error = smart_str(e)
update_fields.append('error')
finally:
notification.save(update_fields=update_fields)
try:
notification.save(update_fields=update_fields)
except Exception as e:
logger.exception(six.text_type('Error saving notification {} result.').format(notification.id))
@shared_task(bind=True, queue=settings.CELERY_DEFAULT_QUEUE)