Use the right domain in each env (#9727)
This commit is contained in:
Родитель
6b2f07be59
Коммит
e6ed0f3371
|
@ -43,7 +43,7 @@ CELERY_TASK_ALWAYS_EAGER = False
|
||||||
ES_DEFAULT_NUM_REPLICAS = 0
|
ES_DEFAULT_NUM_REPLICAS = 0
|
||||||
|
|
||||||
SITE_URL = os.environ.get('OLYMPIA_SITE_URL') or 'http://localhost:8000'
|
SITE_URL = os.environ.get('OLYMPIA_SITE_URL') or 'http://localhost:8000'
|
||||||
SERVICES_DOMAIN = urlparse(SITE_URL).netloc
|
DOMAIN = SERVICES_DOMAIN = urlparse(SITE_URL).netloc
|
||||||
SERVICES_URL = SITE_URL
|
SERVICES_URL = SITE_URL
|
||||||
|
|
||||||
ALLOWED_HOSTS = ALLOWED_HOSTS + [SERVICES_DOMAIN]
|
ALLOWED_HOSTS = ALLOWED_HOSTS + [SERVICES_DOMAIN]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
from django.conf import settings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.http import QueryDict
|
from django.http import QueryDict
|
||||||
from django.utils.html import conditional_escape, format_html
|
from django.utils.html import conditional_escape, format_html
|
||||||
|
@ -48,7 +49,7 @@ class DiscoveryItem(ModelBase):
|
||||||
def build_querystring(self):
|
def build_querystring(self):
|
||||||
qs = QueryDict(mutable=True)
|
qs = QueryDict(mutable=True)
|
||||||
qs.update({
|
qs.update({
|
||||||
'utm_source': 'discovery.addons.mozilla.org',
|
'utm_source': 'discovery.%s' % settings.DOMAIN,
|
||||||
'utm_medium': 'firefox-browser',
|
'utm_medium': 'firefox-browser',
|
||||||
'utm_content': 'discopane-entry-link',
|
'utm_content': 'discopane-entry-link',
|
||||||
'src': 'api',
|
'src': 'api',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from django.http import QueryDict
|
from django.http import QueryDict
|
||||||
|
from django.test.utils import override_settings
|
||||||
|
|
||||||
from olympia import amo
|
from olympia import amo
|
||||||
from olympia.amo.tests import addon_factory, TestCase, user_factory
|
from olympia.amo.tests import addon_factory, TestCase, user_factory
|
||||||
|
@ -184,6 +185,7 @@ class TestDiscoveryItem(TestCase):
|
||||||
type=amo.ADDON_DICT))
|
type=amo.ADDON_DICT))
|
||||||
assert item.description == u''
|
assert item.description == u''
|
||||||
|
|
||||||
|
@override_settings(DOMAIN='addons.mozilla.org')
|
||||||
def test_build_querystring(self):
|
def test_build_querystring(self):
|
||||||
item = DiscoveryItem.objects.create(addon=addon_factory(
|
item = DiscoveryItem.objects.create(addon=addon_factory(
|
||||||
type=amo.ADDON_DICT))
|
type=amo.ADDON_DICT))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче