mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-02-13 14:38:26 +00:00
fix: wrap django 4 imports in try-except block
This commit is contained in:
parent
0ccf48690a
commit
6e5f75b244
@ -0,0 +1,12 @@
|
||||
<!--
|
||||
Create a changelog entry for every new user-facing change. Please respect the following instructions:
|
||||
- Indicate breaking changes by prepending an explosion 💥 character.
|
||||
- Prefix your changes with either [Bugfix], [Improvement], [Feature], [Security], [Deprecation].
|
||||
- You may optionally append "(by @<author>)" at the end of the line, where "<author>" is either one (just one)
|
||||
of your GitHub username, real name or affiliated organization. These affiliations will be displayed in
|
||||
the release notes for every release.
|
||||
-->
|
||||
|
||||
<!-- - 💥[Feature] Foobarize the blorginator. This breaks plugins by renaming the `FOO_DO` filter to `BAR_DO`. (by @regisb) -->
|
||||
<!-- - [Improvement] This is a non-breaking change. Life is good. (by @billgates) -->
|
||||
[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.
|
@ -150,9 +150,12 @@ LOGGING["loggers"]["blockstore.apps.bundles.storage"] = {"handlers": ["console"]
|
||||
# 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:
|
||||
pass
|
||||
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning, module="wiki.plugins.links.wiki_plugin")
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning, module="boto.plugin")
|
||||
|
Loading…
x
Reference in New Issue
Block a user