From ccb92a0f052f7d4ab0263db13676767b6783f441 Mon Sep 17 00:00:00 2001 From: Max Sokolski Date: Fri, 27 Oct 2023 12:17:02 +0300 Subject: [PATCH] chore: update deprecation warning for Django 4.2 Signed-off-by: Max Sokolski --- .../apps/openedx/settings/partials/common_all.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tutor/templates/apps/openedx/settings/partials/common_all.py b/tutor/templates/apps/openedx/settings/partials/common_all.py index c9b747a89f..749f33420e 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_all.py +++ b/tutor/templates/apps/openedx/settings/partials/common_all.py @@ -149,9 +149,16 @@ # These warnings are visible in simple commands and init tasks import warnings -from django.utils.deprecation import RemovedInDjango40Warning, RemovedInDjango41Warning -warnings.filterwarnings("ignore", category=RemovedInDjango40Warning) -warnings.filterwarnings("ignore", category=RemovedInDjango41Warning) + +try: + from django.utils.deprecation import RemovedInDjango50Warning, RemovedInDjango51Warning + warnings.filterwarnings("ignore", category=RemovedInDjango50Warning) + warnings.filterwarnings("ignore", category=RemovedInDjango51Warning) +except ImportError: + from django.utils.deprecation import RemovedInDjango40Warning, RemovedInDjango41Warning + warnings.filterwarnings("ignore", category=RemovedInDjango40Warning) + warnings.filterwarnings("ignore", category=RemovedInDjango41Warning) + 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="botocore.vendored.requests.packages.urllib3._collections")