python: Replace deprecated jinja2.utils.Markup with markupsafe.Markup.

Fixes “DeprecationWarning: 'jinja2.Markup' is deprecated and will be
removed in Jinja 3.1. Import 'markupsafe.Markup' instead.”

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-01-13 13:54:47 -08:00 committed by Anders Kaseorg
parent cf9483e6a9
commit 78e54a0d7a
5 changed files with 5 additions and 5 deletions

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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