mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
python: Convert deprecated Django smart_text alias to smart_str.
django.utils.encoding.smart_text is a deprecated alias of django.utils.encoding.smart_str as of Django 3.0, and will be removed in Django 4.0. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
dcdb00a5e6
commit
2939d29b6d
@@ -4,7 +4,7 @@ from typing import Any, Callable, Dict, Match, Optional
|
||||
import magic
|
||||
import requests
|
||||
from django.conf import settings
|
||||
from django.utils.encoding import smart_text
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from version import ZULIP_VERSION
|
||||
from zerver.lib.cache import cache_with_key, get_cache_with_key, preview_url_cache_key
|
||||
@@ -37,7 +37,7 @@ TIMEOUT = 15
|
||||
|
||||
|
||||
def is_link(url: str) -> Optional[Match[str]]:
|
||||
return link_regex.match(smart_text(url))
|
||||
return link_regex.match(smart_str(url))
|
||||
|
||||
|
||||
def guess_mimetype_from_content(response: requests.Response) -> str:
|
||||
|
Reference in New Issue
Block a user