Use settings.EXTERNAL_HOST when sending activation emails

Activation emails were using django's sites framework which always has
the domain set to zulip.com.

(imported from commit b81eae96e1a75b64dd93970760b869f3271ce88c)
This commit is contained in:
Jason Michalski 2014-07-03 12:18:00 -04:00
parent 6ac6fd5e56
commit 0ea54a043e
2 changed files with 3 additions and 3 deletions

View File

@ -34,8 +34,7 @@ def generate_key():
return generate_random_token(40) return generate_random_token(40)
def generate_activation_url(key): def generate_activation_url(key):
current_site = Site.objects.get_current() return u'https://%s%s' % (settings.EXTERNAL_HOST,
return u'https://%s%s' % (current_site.domain,
reverse('confirmation.views.confirm', kwargs={'confirmation_key': key})) reverse('confirmation.views.confirm', kwargs={'confirmation_key': key}))

View File

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf import settings
from django.test import TestCase from django.test import TestCase
from zilencer.models import Deployment from zilencer.models import Deployment
@ -238,7 +239,7 @@ class LoginTest(AuthedTestCase):
from django.core.mail import outbox from django.core.mail import outbox
for message in reversed(outbox): for message in reversed(outbox):
if email in message.to: if email in message.to:
confirmation_link_pattern = re.compile("example.com(\S+)>") confirmation_link_pattern = re.compile(settings.EXTERNAL_HOST + "(\S+)>")
confirmation_url = confirmation_link_pattern.search( confirmation_url = confirmation_link_pattern.search(
message.body).groups()[0] message.body).groups()[0]
break break