Merge lp:~daker/loco-team-portal/fix.707614 into lp:loco-team-portal

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Chris Johnston
Approved revision: 438
Merged at revision: 456
Proposed branch: lp:~daker/loco-team-portal/fix.707614
Merge into: lp:loco-team-portal
Diff against target: 58 lines (+16/-4)
3 files modified
loco_directory/common/templatetags/teams_tags.py (+12/-0)
loco_directory/templates/irc_chat.html (+2/-2)
loco_directory/templates/teams/team_detail.html (+2/-2)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.707614
Reviewer Review Type Date Requested Status
Chris Johnston Approve
Review via email: mp+65124@code.launchpad.net

Commit message

Fixed the irc nickname when it contains a dot

To post a comment you must log in.
Revision history for this message
Chris Johnston (cjohnston) wrote :
Download full text (4.2 KiB)

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/teams/ubuntu-us-florida
Django Version: 1.2.5
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'common',
 'teams',
 'venues',
 'events',
 'meetings',
 'userprofiles',
 'django_openid_auth',
 'south',
 'bzr_apps']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')

Template error:
In template /home/chris/Dropbox/Projects/loco-directory/reviews/loco_directory/templates/teams/team_detail.html, error at line 2
   'teams_tags' is not a valid tag library: Template library teams_tags not found, tried django.templatetags.teams_tags,django.contrib.admin.templatetags.teams_tags,meetings.templatetags.teams_tags
   1 : {% extends "base.html" %}

   2 : {% load i18n teams_tags %}

   3 :

   4 : {% block title %}{% trans team.name %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}

   5 :

   6 : {% block sub_nav_links %}

   7 : <a class="sub-nav-item" href="{% url team-list %}" title="{% trans "Back to Teams List" %}">{% trans "Back to Teams List" %}</a>

   8 : {% if is_member %}{% else %} <a class="sub-nav-item" href="https://launchpad.net/~{{ team.lp_name }}/+join">{% trans "Join This Team!" %}</a>{% endif %}

   9 : {% if is_admin %}<a class="sub-nav-item" href="{% url team-edit team.lp_name %}" title="{% trans "Edit Details" %}">{% trans "Edit Details" %}</a>{% endif %}

   10 : {% if is_admin and not team.active %}<a class="sub-nav-item" href="{% url select-other-team team.lp_name %}" title="{% trans "Merge with another team" %}">{% trans "Merge team" %}</a>{% endif %}

   11 : {% if is_member %}<a class="sub-nav-item" href="{% url team-event-new team.lp_name %}" title="{% trans "Add New Event" %}">{% trans "Add New Event" %}</a>{% endif %}

   12 : {% if is_member %}<a class="sub-nav-item" href="{% url team-meeting-new team.lp_name %}" title="{% trans "Add New Meeting" %}">{% trans "Add New Meeting" %}</a>{% endif %}

Traceback:
File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py" in get_response
  100. response = callback(request, *callback_args, **callback_kwargs)
File "/home/chris/Dropbox/Projects/loco-directory/reviews/loco_directory/teams/views.py" in team_detail
  170. context, RequestContext(request))
File "/usr/lib/pymodules/python2.7/django/shortcuts/__init__.py" in render_to_response
  20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/lib/pymodules/python2.7/django/template/loader.py" in render_to_string
  181. t = get_template(template_name)
File "/usr/lib/pymodules/python2.7/django/template/loader.py" in get_template
  160. template = get_template_from_string(template, origin, template_name)
File "/usr/lib/pymodules/python2.7/django/template/loader.py" in get_template_fro...

Read more...

review: Needs Fixing
Revision history for this message
Chris Johnston (cjohnston) wrote :

It also looks like the IRC Chat page in the header was not updated as well.

review: Needs Fixing
Revision history for this message
Adnane Belmadiaf (daker) wrote :

Oh yeah the /irc i'll update it.

Revision history for this message
Chris Johnston (cjohnston) wrote :

It worked for me this time on the team details page.. Just needs fixing on the IRC page and it will be ready to go.

review: Needs Fixing
438. By Adnane Belmadiaf

* Fixed the IRC page

Revision history for this message
Chris Johnston (cjohnston) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'loco_directory/common/templatetags'
2=== added file 'loco_directory/common/templatetags/__init__.py'
3=== added file 'loco_directory/common/templatetags/teams_tags.py'
4--- loco_directory/common/templatetags/teams_tags.py 1970-01-01 00:00:00 +0000
5+++ loco_directory/common/templatetags/teams_tags.py 2011-07-16 10:56:34 +0000
6@@ -0,0 +1,12 @@
7+# -*- coding: utf-8 -*-
8+from django import template
9+
10+register = template.Library()
11+
12+def irc(nickname):
13+ """
14+ Replace dots with underscores
15+ """
16+ return nickname.replace('.', '_')
17+
18+register.filter('irc', irc)
19
20=== modified file 'loco_directory/templates/irc_chat.html'
21--- loco_directory/templates/irc_chat.html 2011-02-03 01:43:39 +0000
22+++ loco_directory/templates/irc_chat.html 2011-07-16 10:56:34 +0000
23@@ -1,5 +1,5 @@
24 {% extends "base.html" %}
25-{% load i18n %}
26+{% load i18n teams_tags %}
27
28 {% block title %} {% trans "Ubuntu LoCo Teams IRC Chat" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
29
30@@ -17,7 +17,7 @@
31 <br />
32 <div id="ircchat">
33 {% if user.is_authenticated %}
34- <iframe src="http://webchat.freenode.net/?channels=#ubuntu-locoteams&prompt=1&uio=MTE9MzE28&nick={{ user.username }}" width="900" height="400"></iframe>
35+ <iframe src="http://webchat.freenode.net/?channels=#ubuntu-locoteams&prompt=1&uio=MTE9MzE28&nick={{ user.username|irc }}" width="900" height="400"></iframe>
36 {% else %}
37 <iframe src="http://webchat.freenode.net/?channels=#ubuntu-locoteams&prompt=1&uio=MTE9MzE28&nick=locodir-user" width="900" height="400"></iframe>
38 {% endif %}
39
40=== modified file 'loco_directory/templates/teams/team_detail.html'
41--- loco_directory/templates/teams/team_detail.html 2011-06-13 11:17:32 +0000
42+++ loco_directory/templates/teams/team_detail.html 2011-07-16 10:56:34 +0000
43@@ -1,5 +1,5 @@
44 {% extends "base.html" %}
45-{% load i18n %}
46+{% load i18n teams_tags %}
47
48 {% block title %}{% trans team.name %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
49
50@@ -215,7 +215,7 @@
51 {% if team.irc_chan %}
52 <div id="webchat">
53 {% if user.is_authenticated %}
54- <iframe src="http://webchat.freenode.net/?channels={{ team.irc_chan }}&prompt=1&uio=OT10cnVlJjEwPXRydWUmMTE9MjM218&nick={{ user.username }}" width="900" height="400"></iframe>
55+ <iframe src="http://webchat.freenode.net/?channels={{ team.irc_chan }}&prompt=1&uio=OT10cnVlJjEwPXRydWUmMTE9MjM218&nick={{ user.username|irc }}" width="900" height="400"></iframe>
56 {% else %}
57 <iframe src="http://webchat.freenode.net/?channels={{ team.irc_chan }}&prompt=1&uio=OT10cnVlJjEwPXRydWUmMTE9MjM218&nick=locodir-user" width="900" height="400"></iframe>
58 {% endif %}

Subscribers

People subscribed via source and target branches