mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
Multi-org: format base path, not including protocol (#7260)
Remove hard-coded 'https://' when MULTI_ORG is enabled
This commit is contained in:
@@ -211,7 +211,7 @@ def collect_parameters_from_request(args):
|
||||
|
||||
def base_url(org):
|
||||
if settings.MULTI_ORG:
|
||||
return "https://{}/{}".format(settings.HOST, org.slug)
|
||||
return "{}/{}".format(settings.HOST, org.slug)
|
||||
|
||||
return settings.HOST
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import textwrap
|
||||
from unittest import TestCase
|
||||
|
||||
from redash import settings
|
||||
from redash.models import OPERATORS, Alert, db, next_state
|
||||
from tests import BaseTestCase
|
||||
|
||||
@@ -176,16 +177,18 @@ class TestAlertRenderTemplate(BaseTestCase):
|
||||
ALERT_CONDITION equals
|
||||
ALERT_THRESHOLD 5
|
||||
ALERT_NAME %s
|
||||
ALERT_URL https:///default/alerts/%d
|
||||
ALERT_URL %s/default/alerts/%d
|
||||
QUERY_NAME Query
|
||||
QUERY_URL https:///default/queries/%d
|
||||
QUERY_URL %s/default/queries/%d
|
||||
QUERY_RESULT_VALUE 1
|
||||
QUERY_RESULT_ROWS [{'foo': 1}]
|
||||
QUERY_RESULT_COLS [{'name': 'foo', 'type': 'STRING'}]
|
||||
</pre>
|
||||
""" % (
|
||||
alert.name,
|
||||
settings.HOST,
|
||||
alert.id,
|
||||
settings.HOST,
|
||||
alert.query_id,
|
||||
)
|
||||
result = alert.render_template(textwrap.dedent(custom_alert))
|
||||
|
||||
Reference in New Issue
Block a user