Merge lp:~cjohnston/loco-team-portal/openid into lp:loco-team-portal

Proposed by Chris Johnston
Status: Merged
Approved by: Michael Hall
Approved revision: no longer in the source branch.
Merged at revision: 490
Proposed branch: lp:~cjohnston/loco-team-portal/openid
Merge into: lp:loco-team-portal
Diff against target: 248 lines (+92/-16)
5 files modified
loco_directory/common/views.py (+28/-2)
loco_directory/locale/loco-directory.pot (+11/-13)
loco_directory/settings.py (+3/-0)
loco_directory/templates/login_failure.html (+40/-0)
loco_directory/urls.py (+10/-1)
To merge this branch: bzr merge lp:~cjohnston/loco-team-portal/openid
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Review via email: mp+78184@code.launchpad.net

Commit message

Updates LTP to work with new django-openid-auth

To post a comment you must log in.
486. By Alan Bell

[r=chrisjohnston] fixed bug in requirements of python-feedreader
added more useful back button to event and meeting
fixing extra cell in attendee table header

487. By Chris Johnston

[r=nigelbabu] Changes LoCo Directory to LoCo Team Portal

488. By Michael Hall

[r=chrisjohnston] Adds a wsgi file so we can stop using mod_python

489. By Chris Johnston

[r=chrisjohnston] Adds missing translation string.

Revision history for this message
Michael Hall (mhall119) wrote :

Needs the new login failure page from my branch

review: Needs Fixing
Revision history for this message
Michael Hall (mhall119) wrote :

Looks good

review: Approve
490. By Michael Hall

[r=mhall119] Updates LTP to work with new django-openid-auth

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'loco_directory/common/views.py'
--- loco_directory/common/views.py 2011-06-01 22:19:20 +0000
+++ loco_directory/common/views.py 2011-10-10 20:54:23 +0000
@@ -1,11 +1,22 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2from django.http import HttpResponseRedirect2from django.http import HttpResponse, HttpResponseRedirect
3from django.shortcuts import render_to_response3from django.shortcuts import render_to_response
4from django.template import RequestContext4from django.template import RequestContext
5from django.template.loader import render_to_string
5from django.contrib.auth import logout6from django.contrib.auth import logout
6from django.utils.translation import check_for_language7from django.utils.translation import check_for_language
7from django.conf import settings8from django.conf import settings
89
10try:
11 from django_openid_auth.exceptions import (
12 MissingPhysicalMultiFactor,
13 MissingUsernameViolation,
14 )
15except ImportError:
16 MissingPhysicalMultiFactor = None
17 MissingUsernameViolation = None
18
19
9def index(request):20def index(request):
10 from events.models import GlobalEvent, TeamEvent21 from events.models import GlobalEvent, TeamEvent
11 from meetings.models import TeamMeeting22 from meetings.models import TeamMeeting
@@ -132,5 +143,20 @@
132 meeting_list = meeting_list.filter(Q(name__icontains=q) | Q(teams__name__icontains=q) | Q(agenda__title__icontains=q)).distinct()143 meeting_list = meeting_list.filter(Q(name__icontains=q) | Q(teams__name__icontains=q) | Q(agenda__title__icontains=q)).distinct()
133 return meeting_list144 return meeting_list
134 145
135 146def login_failure(request, message, status=403,
147 template_name='login_failure.html',
148 exception=None):
149 """Render an error page to the user."""
150 context = {
151 'message': message,
152 'exception': exception,
153 }
154 if isinstance(exception, MissingPhysicalMultiFactor):
155 context['solution'] = 'Try logging in again using your Yubikey'
156 elif isinstance(exception, MissingUsernameViolation):
157 context['solution'] = 'You will need to create a <a href="https://launchpad.net/people/+me">Launchpad profile</a> to use the LoCo Teams Directory'
158
159 data = render_to_string(template_name, context,
160 context_instance=RequestContext(request))
161 return HttpResponse(data, status=status)
136162
137163
=== modified file 'loco_directory/locale/loco-directory.pot'
--- loco_directory/locale/loco-directory.pot 2011-10-10 14:16:42 +0000
+++ loco_directory/locale/loco-directory.pot 2011-10-10 20:54:23 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2011-10-10 14:16+0000\n"11"POT-Creation-Date: 2011-10-05 00:49+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -184,7 +184,7 @@
184msgstr ""184msgstr ""
185185
186#: events/models.py:229186#: events/models.py:229
187#: templates/events/team_event_detail_attendees.inc.html:37187#: templates/events/team_event_detail_attendees.inc.html:35
188msgid "Additional Guests"188msgid "Additional Guests"
189msgstr ""189msgstr ""
190190
@@ -942,10 +942,6 @@
942msgid "Click on your continent to find teams near you."942msgid "Click on your continent to find teams near you."
943msgstr ""943msgstr ""
944944
945#: templates/index.html:60
946msgid "Latest blog articles"
947msgstr ""
948
949#: templates/index.html:79945#: templates/index.html:79
950msgid "Read More"946msgid "Read More"
951msgstr ""947msgstr ""
@@ -1140,6 +1136,7 @@
11401136
1141#: templates/events/event_history_list.html:71137#: templates/events/event_history_list.html:7
1142#: templates/events/global_event_detail.html:241138#: templates/events/global_event_detail.html:24
1139#: templates/events/team_event_detail.html:7
1143msgid "Back to Events List"1140msgid "Back to Events List"
1144msgstr ""1141msgstr ""
11451142
@@ -1256,14 +1253,14 @@
1256msgstr ""1253msgstr ""
12571254
1258#: templates/events/global_event_detail.html:271255#: templates/events/global_event_detail.html:27
1259#: templates/events/team_event_detail.html:121256#: templates/events/team_event_detail.html:11
1260#: templates/meetings/team_meeting_detail.html:101257#: templates/meetings/team_meeting_detail.html:10
1261#: templates/teams/team_detail.html:91258#: templates/teams/team_detail.html:9
1262msgid "Edit Details"1259msgid "Edit Details"
1263msgstr ""1260msgstr ""
12641261
1265#: templates/events/global_event_detail.html:281262#: templates/events/global_event_detail.html:28
1266#: templates/events/team_event_detail.html:131263#: templates/events/team_event_detail.html:12
1267msgid "Delete Event"1264msgid "Delete Event"
1268msgstr ""1265msgstr ""
12691266
@@ -1391,16 +1388,16 @@
1391msgid "Delete"1388msgid "Delete"
1392msgstr ""1389msgstr ""
13931390
1394#: templates/events/team_event_detail.html:91391#: templates/events/team_event_detail.html:8
1395#: templates/events/team_event_detail_comments.inc.html:61392#: templates/events/team_event_detail_comments.inc.html:6
1396msgid "Add Comment"1393msgid "Add Comment"
1397msgstr ""1394msgstr ""
13981395
1399#: templates/events/team_event_detail.html:141396#: templates/events/team_event_detail.html:13
1400msgid "Copy Event"1397msgid "Copy Event"
1401msgstr ""1398msgstr ""
14021399
1403#: templates/events/team_event_detail.html:171400#: templates/events/team_event_detail.html:16
1404#: templates/meetings/team_meeting_detail.html:151401#: templates/meetings/team_meeting_detail.html:15
1405#: templates/teams/team_detail.html:1601402#: templates/teams/team_detail.html:160
1406msgid "iCal Feed"1403msgid "iCal Feed"
@@ -1417,7 +1414,7 @@
1417msgstr ""1414msgstr ""
14181415
1419#: templates/events/team_event_detail.inc.html:251416#: templates/events/team_event_detail.inc.html:25
1420#: templates/events/team_event_detail_attendees.inc.html:351417#: templates/events/team_event_detail_attendees.inc.html:33
1421msgid "Attendees"1418msgid "Attendees"
1422msgstr ""1419msgstr ""
14231420
@@ -1438,7 +1435,7 @@
1438msgid "Maybe attending:"1435msgid "Maybe attending:"
1439msgstr ""1436msgstr ""
14401437
1441#: templates/events/team_event_detail_attendees.inc.html:361438#: templates/events/team_event_detail_attendees.inc.html:34
1442msgid "Registration Status"1439msgid "Registration Status"
1443msgstr ""1440msgstr ""
14441441
@@ -1605,6 +1602,7 @@
1605msgstr ""1602msgstr ""
16061603
1607#: templates/meetings/meeting_history_list.html:71604#: templates/meetings/meeting_history_list.html:7
1605#: templates/meetings/team_meeting_detail.html:7
1608msgid "Back to Meetings List"1606msgid "Back to Meetings List"
1609msgstr ""1607msgstr ""
16101608
16111609
=== modified file 'loco_directory/settings.py'
--- loco_directory/settings.py 2011-10-05 00:50:53 +0000
+++ loco_directory/settings.py 2011-10-10 20:54:23 +0000
@@ -32,6 +32,9 @@
32TEMPLATE_DEBUG = DEBUG32TEMPLATE_DEBUG = DEBUG
33STATIC_SERVE = True33STATIC_SERVE = True
3434
35OPENID_STRICT_USERNAMES=True
36OPENID_FOLLOW_RENAMES=True
37
35from common import utils38from common import utils
36VERSION_STRING = utils.get_locodirectory_version(39VERSION_STRING = utils.get_locodirectory_version(
37 os.path.join(PROJECT_PATH, "version"),40 os.path.join(PROJECT_PATH, "version"),
3841
=== added file 'loco_directory/templates/login_failure.html'
--- loco_directory/templates/login_failure.html 1970-01-01 00:00:00 +0000
+++ loco_directory/templates/login_failure.html 2011-10-10 20:54:23 +0000
@@ -0,0 +1,40 @@
1{% extends "base.html" %}
2{% load i18n %}
3
4{% block title %} {% trans "Login Failure" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
5
6{% block defaulthead %}
7{% with '/ubuntu-website/media/' as ubuntu_website_media %}
8{{ block.super }}
9{% endwith %}
10{% endblock %}
11
12{% block extrahead %}
13{% with '/media/' as MEDIA_URL %}
14{{ block.super }}
15{% endwith %}
16{% endblock %}
17{% block main_nav_links %}{% endblock %}
18
19{% block sub_nav %}{% endblock %}
20
21{% block content %}
22
23<article class="main-content">
24 <h2>{{message|safe}}</h2>
25
26 {% if exception %}
27 <p>{{exception.message|safe}}</p>
28 {% endif %}
29
30 {% if solution %}
31 <p>{{solution|safe}}</p>
32 {% endif %}
33
34 <p>{% trans "If you continue to experience problems with LoCo Team Directory, please " %} <a href='https://bugs.launchpad.net/loco-directory'>{% trans "Report it!" %}</a>
35 </p>
36</article>
37
38{% endblock %}
39
40
041
=== modified file 'loco_directory/urls.py'
--- loco_directory/urls.py 2011-03-15 13:08:01 +0000
+++ loco_directory/urls.py 2011-10-10 20:54:23 +0000
@@ -3,6 +3,8 @@
3from django.contrib import admin3from django.contrib import admin
4import ubuntu_website4import ubuntu_website
55
6from common.views import login_failure
7
6admin.autodiscover()8admin.autodiscover()
79
8urlpatterns = patterns('',10urlpatterns = patterns('',
@@ -12,7 +14,6 @@
12 url(r'^irc/$', 'common.views.irc_chat', name='irc_chat'),14 url(r'^irc/$', 'common.views.irc_chat', name='irc_chat'),
13 url(r'^about-loco/$', 'common.views.about_loco', name='about_loco'),15 url(r'^about-loco/$', 'common.views.about_loco', name='about_loco'),
14 url(r'^using-locodir/$', 'common.views.using_locodir', name='using_locodir'),16 url(r'^using-locodir/$', 'common.views.using_locodir', name='using_locodir'),
15 url(r'^openid/', include('django_openid_auth.urls')),
16 url(r'^admin/(.*)', admin.site.root),17 url(r'^admin/(.*)', admin.site.root),
17 url(r'^data/xml', 'teams.views.xml_team_data', name='xml_team_data'),18 url(r'^data/xml', 'teams.views.xml_team_data', name='xml_team_data'),
18 url(r'^teams/', include('teams.urls')),19 url(r'^teams/', include('teams.urls')),
@@ -27,6 +28,14 @@
27 url(r'^search/', 'common.views.site_search', name='site_search'),28 url(r'^search/', 'common.views.site_search', name='site_search'),
28)29)
2930
31urlpatterns += patterns('django_openid_auth.views',
32 url(r'^openid/login/$', 'login_begin', name='openid-login',
33 kwargs={'render_failure': login_failure}),
34 url(r'^openid/complete/$', 'login_complete', name='openid-complete',
35 kwargs={'render_failure': login_failure}),
36 url(r'^openid/logo.gif$', 'logo', name='openid-logo'),
37)
38
30if settings.STATIC_SERVE:39if settings.STATIC_SERVE:
31 urlpatterns += patterns('',40 urlpatterns += patterns('',
32 (r'^media/(?P<path>.*)$', 'django.views.static.serve',41 (r'^media/(?P<path>.*)$', 'django.views.static.serve',

Subscribers

People subscribed via source and target branches