diff --git a/commerce_coordinator/apps/lms/tasks.py b/commerce_coordinator/apps/lms/tasks.py index f5e3c893..2bf22688 100644 --- a/commerce_coordinator/apps/lms/tasks.py +++ b/commerce_coordinator/apps/lms/tasks.py @@ -36,7 +36,7 @@ def on_failure(self, exc, task_id, args, kwargs, einfo): error_message = ( json.loads(exc.response.text).get('message', '') if hasattr(exc, 'response') and exc.response is not None - else exc + else str(exc) ) logger.error( diff --git a/commerce_coordinator/apps/lms/tests/test_tasks.py b/commerce_coordinator/apps/lms/tests/test_tasks.py index 5d312dfb..5a0df4de 100644 --- a/commerce_coordinator/apps/lms/tests/test_tasks.py +++ b/commerce_coordinator/apps/lms/tests/test_tasks.py @@ -3,7 +3,7 @@ """ import logging -from unittest.mock import patch, sentinel, Mock +from unittest.mock import Mock, patch, sentinel from django.test import TestCase from requests import RequestException diff --git a/docs/conf.py b/docs/conf.py index e1f70b19..7ff2388e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -557,6 +557,8 @@ def setup(app): event = 'builder-inited' app.connect(event, on_init) +# celery.Task has some roles inside the library that are not recognized by Sphinx +# and causing errors, so we add them here to avoid the errors. rst_prolog = """ .. role:: setting .. role:: sig