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.

integrations: Convert deprecated Django url to path.

Anders Kaseorgbdb20a8002a0
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py
index e42a0180a61..dc7dd8402d2 100644
--- a/zerver/lib/integrations.py
+++ b/zerver/lib/integrations.py
@@ -2,9 +2,9 @@ import os
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Sequence, Tuple
-from django.conf.urls import url
from django.contrib.staticfiles.storage import staticfiles_storage
-from django.urls.resolvers import RegexPattern
+from django.urls import path
+from django.urls.resolvers import URLPattern
from django.utils.functional import Promise
from django.utils.module_loading import import_string
from django.utils.translation import gettext as gettext_lazy
@@ -221,8 +221,8 @@ class WebhookIntegration(Integration):
self.doc = doc
@property
- def url_object(self) -> RegexPattern:
- return url(self.url, self.function)
+ def url_object(self) -> URLPattern:
+ return path(self.url, self.function)
def split_fixture_path(path: str) -> Tuple[str, str]:
diff --git a/zerver/webhooks/gitea/tests.py b/zerver/webhooks/gitea/tests.py
index b492c0190c8..5c3b1af92dd 100644
--- a/zerver/webhooks/gitea/tests.py
+++ b/zerver/webhooks/gitea/tests.py
@@ -5,7 +5,7 @@ from zerver.lib.test_classes import WebhookTestCase
class GiteaHookTests(WebhookTestCase):
STREAM_NAME = "commits"
- URL_TEMPLATE = "/api/v1/external/giteae?&api_key={api_key}&stream={stream}"
+ URL_TEMPLATE = "/api/v1/external/gitea?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = "gitea"
def test_multiple_commits(self) -> None: