Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

python: Convert deprecated Django smart_text alias to smart_str.

Anders Kaseorg2939d29b6dc4
diff --git a/zerver/lib/url_preview/preview.py b/zerver/lib/url_preview/preview.py
index 481c7f0d154..4a5dd9820f2 100644
--- a/zerver/lib/url_preview/preview.py
+++ b/zerver/lib/url_preview/preview.py
@@ -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: