diff --git a/cms/celery.py b/cms/celery.py index 293121bcf2..88f38e5b1f 100644 --- a/cms/celery.py +++ b/cms/celery.py @@ -5,9 +5,13 @@ and auto discover tasks in all installed django apps. Taken from: https://celery.readthedocs.org/en/latest/django/first-steps-with-django.html """ - import os +# Patch the xml libs before anything else. +from safe_lxml import defuse_xml_libs + +defuse_xml_libs() + # Set the default Django settings module for the 'celery' program # and then instantiate the Celery singleton. diff --git a/lms/celery.py b/lms/celery.py index 808df030ef..2ca97de3c6 100644 --- a/lms/celery.py +++ b/lms/celery.py @@ -7,6 +7,11 @@ Taken from: https://celery.readthedocs.org/en/latest/django/first-steps-with-dja import os +# Patch the xml libs before anything else. +from safe_lxml import defuse_xml_libs + +defuse_xml_libs() + # Set the default Django settings module for the 'celery' program # and then instantiate the Celery singleton.