Skip to content
Snippets Groups Projects
Commit 3d21f8a8 authored by Benjamin Ledel's avatar Benjamin Ledel
Browse files

Update 2 files

- /src/xapi/tests/tests.py
- /src/xapi/views.py
parent dd3567e0
No related branches found
No related tags found
No related merge requests found
Pipeline #1561564 failed
......@@ -22,6 +22,8 @@ PROJECT_PATH = os.path.abspath(os.path.dirname(__name__))
def mock_store_in_lrs(x_api_statement):
return True
def mock_store_in_lrs(x_api_statement):
return True
class XAPITestCase(TestCase):
test_user_email = "test@mail.com"
......
......@@ -333,7 +333,7 @@ class CreateStatement(APIView):
except Exception as e:
if settings.DEBUG:
print("Could not forward to ", additional_lrs["url"], ":", e)
if not res or res.status_code != 200:
if (not res or res.status_code != 200) and not settings.CELERY_TASK_ALWAYS_EAGER:
retry_forward_statements.delay(x_api_statements, additional_lrs["token_type"], additional_lrs["token"], additional_lrs["url"])
if settings.DEBUG:
print("Could not forward to ", additional_lrs["url"], ":", res.reason if res is not None else "URL could not be reached", "({})".format(res.status_code) if res is not None else "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment