6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-10 17:24:44 +00:00

Merge branch 'MJG/fix-django4-import-errors' into nightly

This commit is contained in:
Kyle D. McCormick 2023-12-18 16:54:10 -05:00
commit aa01e3095d
2 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1 @@
- [Bugfix] Wrap Django5 warning imports in try-except block to avoid failures in django3 that's still in use in edx-platform's master branch (by @mariajgrimaldi).

View File

@ -150,9 +150,16 @@ LOGGING["loggers"]["blockstore.apps.bundles.storage"] = {"handlers": ["console"]
# These warnings are visible in simple commands and init tasks # These warnings are visible in simple commands and init tasks
import warnings import warnings
from django.utils.deprecation import RemovedInDjango50Warning, RemovedInDjango51Warning try:
warnings.filterwarnings("ignore", category=RemovedInDjango50Warning) from django.utils.deprecation import RemovedInDjango50Warning, RemovedInDjango51Warning
warnings.filterwarnings("ignore", category=RemovedInDjango51Warning) warnings.filterwarnings("ignore", category=RemovedInDjango50Warning)
warnings.filterwarnings("ignore", category=RemovedInDjango51Warning)
except ImportError:
# REMOVE-AFTER-V18:
# In Quince, edx-platform uses Django 5. But on master, edx-platform still uses Django 3.
# So, Tutor v17 needs to silence these warnings, whereas Tutor v17-nightly fails to import them.
# Once edx-platform master is upgraded to Django 5, the try-except wrapper can be removed.
pass
warnings.filterwarnings("ignore", category=DeprecationWarning, module="wiki.plugins.links.wiki_plugin") warnings.filterwarnings("ignore", category=DeprecationWarning, module="wiki.plugins.links.wiki_plugin")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="boto.plugin") warnings.filterwarnings("ignore", category=DeprecationWarning, module="boto.plugin")