From: yomguy Date: Thu, 19 Jul 2012 19:57:21 +0000 (+0200) Subject: fix localhost for monitoring conference X-Git-Tag: 0.7.1~5^2~9 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4ded2119c5dd9600e91c5c1839167c278747f6e9;p=teleforma.git fix localhost for monitoring conference --- diff --git a/teleforma/templates/teleforma/course_conference.html b/teleforma/templates/teleforma/course_conference.html index 505ccf08..7d7c6ec3 100644 --- a/teleforma/templates/teleforma/course_conference.html +++ b/teleforma/templates/teleforma/course_conference.html @@ -37,7 +37,7 @@
@@ -45,7 +45,7 @@
{% endif %} diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index 68869a76..2d60abad 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -53,6 +53,7 @@ import django.utils.timezone as timezone from timezones.utils import localtime_for_timezone from django.utils.translation import ugettext_lazy as _ from teleforma.views import get_courses +from urlparse import urlparse register = template.Library() @@ -186,3 +187,12 @@ def get_video_id(media): if m.type == "webm": break return m.id + +@register.filter +def get_host(url, host): + u = urlparse(url) + if host == '127.0.0.1' or host == 'localhost': + u['netloc'] = host + return u.geturl() + else: + return url diff --git a/teleforma/views.py b/teleforma/views.py index 478c702b..24c086b8 100755 --- a/teleforma/views.py +++ b/teleforma/views.py @@ -337,6 +337,7 @@ class ConferenceView(DetailView): context['room'] = get_room(name=conference.course.title, content_type=content_type, id=conference.id) context['livestreams'] = conference.livestream.all() + context['host'] = get_host(self.request) return context @jsonrpc_method('teleforma.conference_stop')