Skip to content

Commit

Permalink
Merge branch 'MJG/fix-django4-import-errors' into nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Dec 18, 2023
2 parents 9035965 + 64d82c3 commit aa01e30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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).
13 changes: 10 additions & 3 deletions tutor/templates/apps/openedx/settings/partials/common_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,16 @@
# These warnings are visible in simple commands and init tasks
import warnings

from django.utils.deprecation import RemovedInDjango50Warning, RemovedInDjango51Warning
warnings.filterwarnings("ignore", category=RemovedInDjango50Warning)
warnings.filterwarnings("ignore", category=RemovedInDjango51Warning)
try:
from django.utils.deprecation import RemovedInDjango50Warning, 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="boto.plugin")
Expand Down

0 comments on commit aa01e30

Please sign in to comment.