From 78e54a0d7a6629e5deae10b1aedfa634738af82e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 13 Jan 2022 13:54:47 -0800 Subject: [PATCH] python: Replace deprecated jinja2.utils.Markup with markupsafe.Markup. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes “DeprecationWarning: 'jinja2.Markup' is deprecated and will be removed in Jinja 3.1. Import 'markupsafe.Markup' instead.” Signed-off-by: Anders Kaseorg --- analytics/views/activity_common.py | 2 +- analytics/views/installation_activity.py | 2 +- zerver/forms.py | 2 +- zerver/lib/upload.py | 2 +- zerver/views/auth.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/analytics/views/activity_common.py b/analytics/views/activity_common.py index ef285e8bce..c6cf762aac 100644 --- a/analytics/views/activity_common.py +++ b/analytics/views/activity_common.py @@ -9,7 +9,7 @@ from django.db.backends.utils import CursorWrapper from django.db.models.query import QuerySet from django.template import loader from django.urls import reverse -from jinja2.utils import Markup as mark_safe +from markupsafe import Markup as mark_safe eastern_tz = pytz.timezone("US/Eastern") diff --git a/analytics/views/installation_activity.py b/analytics/views/installation_activity.py index 9dd2dfe19f..5bbe3ab1a7 100644 --- a/analytics/views/installation_activity.py +++ b/analytics/views/installation_activity.py @@ -10,7 +10,7 @@ from django.http import HttpRequest, HttpResponse from django.shortcuts import render from django.template import loader from django.utils.timezone import now as timezone_now -from jinja2.utils import Markup as mark_safe +from markupsafe import Markup as mark_safe from psycopg2.sql import SQL, Composable, Literal from analytics.lib.counts import COUNT_STATS diff --git a/zerver/forms.py b/zerver/forms.py index 35f1055b64..25e47c65f0 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -14,7 +14,7 @@ from django.http import HttpRequest from django.urls import reverse from django.utils.http import urlsafe_base64_encode from django.utils.translation import gettext as _ -from jinja2.utils import Markup as mark_safe +from markupsafe import Markup as mark_safe from two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenForm from two_factor.utils import totp_digits diff --git a/zerver/lib/upload.py b/zerver/lib/upload.py index 67fc84b072..97c82ef9ee 100644 --- a/zerver/lib/upload.py +++ b/zerver/lib/upload.py @@ -23,7 +23,7 @@ from django.core.signing import BadSignature, TimestampSigner from django.http import HttpRequest from django.urls import reverse from django.utils.translation import gettext as _ -from jinja2.utils import Markup as mark_safe +from markupsafe import Markup as mark_safe from mypy_boto3_s3.client import S3Client from mypy_boto3_s3.service_resource import Bucket, Object from PIL import Image, ImageOps diff --git a/zerver/views/auth.py b/zerver/views/auth.py index f185348d3c..9d242cff95 100644 --- a/zerver/views/auth.py +++ b/zerver/views/auth.py @@ -24,7 +24,7 @@ from django.utils.http import url_has_allowed_host_and_scheme from django.utils.translation import gettext as _ from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_safe -from jinja2.utils import Markup as mark_safe +from markupsafe import Markup as mark_safe from social_django.utils import load_backend, load_strategy from two_factor.forms import BackupTokenForm from two_factor.views import LoginView as BaseTwoFactorLoginView