mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
Django 1.10: Upgrade integration urls.
This commit is contained in:
@@ -2,6 +2,7 @@ from typing import Dict, List, Optional, TypeVar
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from django.core.urlresolvers import LocaleRegexProvider
|
from django.core.urlresolvers import LocaleRegexProvider
|
||||||
|
from django.utils.module_loading import import_string
|
||||||
|
|
||||||
"""This module declares all of the (documented) integrations available
|
"""This module declares all of the (documented) integrations available
|
||||||
in the Zulip server. The Integration class is used as part of
|
in the Zulip server. The Integration class is used as part of
|
||||||
@@ -60,6 +61,10 @@ class WebhookIntegration(Integration):
|
|||||||
|
|
||||||
if function is None:
|
if function is None:
|
||||||
function = self.DEFAULT_FUNCTION_PATH.format(name=name)
|
function = self.DEFAULT_FUNCTION_PATH.format(name=name)
|
||||||
|
|
||||||
|
if isinstance(function, str):
|
||||||
|
function = import_string(function)
|
||||||
|
|
||||||
self.function = function
|
self.function = function
|
||||||
|
|
||||||
if url is None:
|
if url is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user