Merge lp:~cjohnston/summit/update-django-1-4 into lp:summit

Proposed by Chris Johnston
Status: Merged
Approved by: Michael Hall
Approved revision: 506
Merged at revision: 510
Proposed branch: lp:~cjohnston/summit/update-django-1-4
Merge into: lp:summit
Diff against target: 433 lines (+113/-70)
12 files modified
requirements.txt (+2/-2)
setup.py (+1/-1)
summit/common/management/commands/lpupdate.py (+24/-6)
summit/schedule/admin/attendeeadmin.py (+22/-5)
summit/schedule/admin/crewadmin.py (+6/-2)
summit/schedule/admin/leadadmin.py (+6/-2)
summit/schedule/admin/meetingadmin.py (+17/-10)
summit/schedule/admin/roomadmin.py (+11/-2)
summit/schedule/admin/summitadmin.py (+7/-12)
summit/schedule/forms.py (+2/-0)
summit/schedule/models/attendeemodel.py (+8/-5)
summit/settings.py (+7/-23)
To merge this branch: bzr merge lp:~cjohnston/summit/update-django-1-4
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Review via email: mp+152552@code.launchpad.net

Commit message

Updates Summit to work with Django 1.4.x... This will allow much improvement for the vUDS events.

To post a comment you must log in.
506. By Chris Johnston

Fixes conflict

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

Approving because the next branch will fix any lingering test failures

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'requirements.txt'
2--- requirements.txt 2013-02-20 13:57:06 +0000
3+++ requirements.txt 2013-03-09 05:16:21 +0000
4@@ -6,8 +6,8 @@
5 # include patches applied by the package maintainers.
6 #
7
8-Django==1.3.2
9-South==0.7.3
10+Django==1.4.5
11+South==0.7.5
12 bzr>=2.4b4
13 distribute==0.6.10
14 django-openid-auth==0.4
15
16=== modified file 'setup.py'
17--- setup.py 2012-03-31 02:50:39 +0000
18+++ setup.py 2013-03-09 05:16:21 +0000
19@@ -41,7 +41,7 @@
20 packages = packages,
21 zip_safe = False,
22 install_requires = [
23- "Django==1.3.1",
24+ "Django==1.4.5",
25 "psycopg2>=2.0.9",
26 "pytz",
27 "BeautifulSoup",
28
29=== modified file 'summit/common/management/commands/lpupdate.py'
30--- summit/common/management/commands/lpupdate.py 2013-02-26 19:31:21 +0000
31+++ summit/common/management/commands/lpupdate.py 2013-03-09 05:16:21 +0000
32@@ -26,12 +26,30 @@
33
34 class Command(BaseCommand):
35 option_list = BaseCommand.option_list + (
36- make_option("-s", "--slots", dest="slots",
37- help="Number of slots an imported meeting needs", type=int, default=1),
38- make_option("-A", "--no-attendees", dest="skip_attendees", action="store_true",
39- help="Don't import Attendee data", default=False),
40- make_option("-M", "--no-meetings", dest="skip_meetings", action="store_true",
41- help="Don't import Meeting data", default=False),
42+ make_option(
43+ "-s",
44+ "--slots",
45+ dest="slots",
46+ help="Number of slots an imported meeting needs",
47+ type=int,
48+ default=1
49+ ),
50+ make_option(
51+ "-A",
52+ "--no-attendees",
53+ dest="skip_attendees",
54+ action="store_true",
55+ help="Don't import Attendee data",
56+ default=False
57+ ),
58+ make_option(
59+ "-M",
60+ "--no-meetings",
61+ dest="skip_meetings",
62+ action="store_true",
63+ help="Don't import Meeting data",
64+ default=False
65+ ),
66 )
67
68 def handle(self, summit='', *args, **options):
69
70=== modified file 'summit/schedule/admin/attendeeadmin.py'
71--- summit/schedule/admin/attendeeadmin.py 2013-02-26 19:31:21 +0000
72+++ summit/schedule/admin/attendeeadmin.py 2013-03-09 05:16:21 +0000
73@@ -31,23 +31,40 @@
74 list_display = ('summit', 'user')
75 list_display_links = ('user', )
76 list_filter = ('summit', )
77- search_fields = ('user__username', 'user__first_name', 'user__last_name',
78- 'user__email')
79+ search_fields = (
80+ 'user__username',
81+ 'user__first_name',
82+ 'user__last_name',
83+ 'user__email'
84+ )
85 inlines = (AttendeeBusyInline, )
86
87
88 class ParticipantAdmin(admin.ModelAdmin):
89 list_display = ('meeting', 'attendee', 'participation')
90 list_display_links = ('attendee', )
91- search_fields = ('attendee__user__username', 'attendee__user__first_name', 'attendee__user__last_name',
92- 'attendee__user__email', 'meeting__name', 'meeting__title')
93+ search_fields = (
94+ 'attendee__user__username',
95+ 'attendee__user__first_name',
96+ 'attendee__user__last_name',
97+ 'attendee__user__email',
98+ 'meeting__name',
99+ 'meeting__title'
100+ )
101
102 def formfield_for_foreignkey(self, db_field, request, **kwargs):
103 if db_field.name == "meeting":
104 kwargs["queryset"] = Meeting.objects.order_by('name')
105 if db_field.name == "attendee":
106 kwargs["queryset"] = Attendee.objects.order_by('user__username')
107- return super(ParticipantAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
108+ return super(
109+ ParticipantAdmin,
110+ self
111+ ).formfield_for_foreignkey(
112+ db_field,
113+ request,
114+ **kwargs
115+ )
116
117
118 admin.site.register(Attendee, AttendeeAdmin)
119
120=== modified file 'summit/schedule/admin/crewadmin.py'
121--- summit/schedule/admin/crewadmin.py 2013-02-26 19:31:21 +0000
122+++ summit/schedule/admin/crewadmin.py 2013-03-09 05:16:21 +0000
123@@ -26,7 +26,11 @@
124 list_display = ('attendee', 'date_utc')
125 list_display_links = ('attendee', 'date_utc')
126 list_filter = ('date_utc',)
127- search_fields = ('attendee__user__username', 'attendee__user__first_name',
128- 'attendee__user__last_name', 'attendee__user__email')
129+ search_fields = (
130+ 'attendee__user__username',
131+ 'attendee__user__first_name',
132+ 'attendee__user__last_name',
133+ 'attendee__user__email'
134+ )
135
136 admin.site.register(Crew, CrewAdmin)
137
138=== modified file 'summit/schedule/admin/leadadmin.py'
139--- summit/schedule/admin/leadadmin.py 2013-02-26 19:31:21 +0000
140+++ summit/schedule/admin/leadadmin.py 2013-03-09 05:16:21 +0000
141@@ -26,7 +26,11 @@
142 list_display = ('summit', 'track', 'lead')
143 list_display_links = ('summit', 'track')
144 list_filter = ('summit', 'track')
145- search_fields = ('attendee__user__username', 'attendee__user__first_name',
146- 'attendee__user__last_name', 'attendee__user__email')
147+ search_fields = (
148+ 'attendee__user__username',
149+ 'attendee__user__first_name',
150+ 'attendee__user__last_name',
151+ 'attendee__user__email'
152+ )
153
154 admin.site.register(Lead, LeadAdmin)
155
156=== modified file 'summit/schedule/admin/meetingadmin.py'
157--- summit/schedule/admin/meetingadmin.py 2013-02-26 19:31:21 +0000
158+++ summit/schedule/admin/meetingadmin.py 2013-03-09 05:16:21 +0000
159@@ -15,7 +15,6 @@
160 # along with this program. If not, see <http://www.gnu.org/licenses/>.
161
162 from django import forms
163-from django.conf import settings
164 from django.contrib import admin
165 from django.forms.util import flatatt
166 from django.utils.encoding import force_unicode
167@@ -49,20 +48,25 @@
168 model = Participant
169 template = 'admin/edit_inline/collapsed_tabular.html'
170
171- def _media(self):
172- media = super(ParticipantInline, self)._media()
173- media.add_js(('%sjs/collapse.min.js'
174- % settings.ADMIN_MEDIA_PREFIX, ))
175- return media
176- media = property(_media)
177-
178 def get_formset(self, request, obj=None, **kwargs):
179 fs = super(ParticipantInline, self).get_formset(request, obj, **kwargs)
180 if fs and obj:
181- fs = super(ParticipantInline, self).get_formset(request, obj, **kwargs)
182- fs.form.base_fields['attendee'].queryset = fs.form.base_fields['attendee'].queryset.filter(summit=obj.summit)
183+ fs = super(
184+ ParticipantInline,
185+ self
186+ ).get_formset(
187+ request,
188+ obj,
189+ **kwargs
190+ )
191+ fs.form.base_fields[
192+ 'attendee'
193+ ].queryset = fs.form.base_fields[
194+ 'attendee'
195+ ].queryset.filter(summit=obj.summit)
196 return fs
197
198+
199 class MeetingAdminForm(forms.ModelForm):
200 drafter = forms.CharField(required=False, widget=AttendeeInput)
201 assignee = forms.CharField(required=False, widget=AttendeeInput)
202@@ -131,6 +135,7 @@
203 meeting.share()
204 share.short_description = "Share Meetings (Private only)"
205
206+
207 class MeetingAdmin(admin.ModelAdmin):
208 list_display = (
209 'summit',
210@@ -175,9 +180,11 @@
211 ),
212 }),
213 ("Hangout details", {
214+ 'classes': ('collapse', ),
215 'fields': ('hangout_url', 'broadcast_url',)
216 }),
217 ("References", {
218+ 'classes': ('collapse', ),
219 'fields': (
220 'spec_url',
221 'launchpad_blueprint_id',
222
223=== modified file 'summit/schedule/admin/roomadmin.py'
224--- summit/schedule/admin/roomadmin.py 2013-02-26 19:31:21 +0000
225+++ summit/schedule/admin/roomadmin.py 2013-03-09 05:16:21 +0000
226@@ -36,8 +36,17 @@
227
228 fieldsets = (
229 (None, {
230- 'fields': ('summit', 'name', 'title', 'type', 'size', 'tracks',
231- 'icecast_url', 'irc_channel', 'has_dial_in'),
232+ 'fields': (
233+ 'summit',
234+ 'name',
235+ 'title',
236+ 'type',
237+ 'size',
238+ 'tracks',
239+ 'icecast_url',
240+ 'irc_channel',
241+ 'has_dial_in'
242+ ),
243 }),
244 ("Availability", {
245 'fields': ('start_utc', 'end_utc'),
246
247=== modified file 'summit/schedule/admin/summitadmin.py'
248--- summit/schedule/admin/summitadmin.py 2013-02-26 19:31:21 +0000
249+++ summit/schedule/admin/summitadmin.py 2013-03-09 05:16:21 +0000
250@@ -34,12 +34,10 @@
251
252 template = 'admin/edit_inline/collapsed_tabular.html'
253
254- def _media(self):
255- media = super(TrackInline, self)._media()
256- media.add_js(('%sjs/collapse.min.js'
257- % settings.ADMIN_MEDIA_PREFIX, ))
258- return media
259- media = property(_media)
260+ class Media:
261+ media_url = getattr(settings, 'STATIC_URL', '/static/')
262+ js = [media_url+'admin/js/collapse.min.js', ]
263+
264
265 class SprintInline(admin.TabularInline):
266 model = SummitSprint
267@@ -47,12 +45,9 @@
268
269 template = 'admin/edit_inline/collapsed_tabular.html'
270
271- def _media(self):
272- media = super(SprintInline, self)._media()
273- media.add_js(('%sjs/collapse.min.js'
274- % settings.ADMIN_MEDIA_PREFIX, ))
275- return media
276- media = property(_media)
277+ class Media:
278+ media_url = getattr(settings, 'STATIC_URL', '/static/')
279+ js = [media_url+'admin/js/collapse.min.js', ]
280
281
282 class SummitAdmin(admin.ModelAdmin):
283
284=== modified file 'summit/schedule/forms.py'
285--- summit/schedule/forms.py 2013-03-05 22:42:44 +0000
286+++ summit/schedule/forms.py 2013-03-09 05:16:21 +0000
287@@ -202,6 +202,7 @@
288 YOUTUBE_PAGE_URL = re.compile(r'https?:\/\/www.youtube.com\/watch\?v=(?P<youtube_id>[^&]*).*')
289 YOUTUBE_SHORT_URL = re.compile(r'https?:\/\/youtu.be\/(?P<youtube_id>[^\?]*).*')
290
291+
292 class YouTubeEmbedURL(forms.URLField):
293
294 def clean(self, value):
295@@ -218,6 +219,7 @@
296 pass
297 return value
298
299+
300 class EditMeetingHangout(forms.ModelForm, RenderableMixin):
301 class Meta:
302 model = Meeting
303
304=== modified file 'summit/schedule/models/attendeemodel.py'
305--- summit/schedule/models/attendeemodel.py 2013-02-26 19:31:21 +0000
306+++ summit/schedule/models/attendeemodel.py 2013-03-09 05:16:21 +0000
307@@ -35,8 +35,9 @@
308 class Attendee(models.Model):
309 summit = models.ForeignKey(Summit)
310 user = models.ForeignKey(User)
311- start_utc = models.DateTimeField(db_column='start',
312- verbose_name="Start (UTC)")
313+ start_utc = models.DateTimeField(
314+ db_column='start',
315+ verbose_name="Start (UTC)")
316 end_utc = models.DateTimeField(db_column='end',
317 verbose_name="End (UTC)")
318 # FIXME restrict to tracks that match summit
319@@ -112,9 +113,11 @@
320 # login; but maybe they never will (logic copied from openid auth)
321 fullname = elem.get("displayname", '')
322 if fullname:
323- if ' ' in fullname:
324- self.user.first_name, self.user.last_name \
325- = fullname.rsplit(None, 1)
326+ #if ' ' in fullname:
327+ fullname = fullname.strip()
328+ split_names = fullname.rsplit(None, 1)
329+ if len(split_names) == 2:
330+ self.user.first_name, self.user.last_name = split_names
331 self.user.first_name = self.user.first_name[:30]
332 self.user.last_name = self.user.last_name[:30]
333 else:
334
335=== modified file 'summit/settings.py'
336--- summit/settings.py 2013-03-09 05:00:49 +0000
337+++ summit/settings.py 2013-03-09 05:16:21 +0000
338@@ -25,10 +25,6 @@
339
340 SERVE_STATIC = True
341
342-OPENID_STRICT_USERNAMES = True
343-OPENID_FOLLOW_RENAMES = True
344-OPENID_SREG_REQUIRED_FIELDS = ['email']
345-
346 SITE_ROOT = 'http://summit.ubuntu.com'
347
348 ADMINS = (
349@@ -55,14 +51,10 @@
350 # system time zone.
351 TIME_ZONE = 'UTC'
352
353-# Language code for this installation. All choices can be found here:
354-# http://www.i18nguy.com/unicode/language-identifiers.html
355 LANGUAGE_CODE = 'en-us'
356
357 SITE_ID = 1
358
359-# If you set this to False, Django will make some optimizations so as not
360-# to load the internationalization machinery.
361 USE_I18N = False
362
363 # Absolute path to the directory that holds media.
364@@ -80,14 +72,11 @@
365 # URL Location for static media
366 STATIC_URL = "/static/"
367
368-# Make this unique, and don't share it with anybody.
369 SECRET_KEY = ''
370
371-# List of callables that know how to import templates from various sources.
372 TEMPLATE_LOADERS = (
373 'django.template.loaders.filesystem.Loader',
374 'django.template.loaders.app_directories.Loader',
375-# 'django.template.loaders.eggs.load_template_source',
376 )
377
378 TEMPLATE_CONTEXT_PROCESSORS = (
379@@ -96,6 +85,7 @@
380 "django.core.context_processors.i18n",
381 "django.core.context_processors.media",
382 "django.core.context_processors.request",
383+ "django.contrib.messages.context_processors.messages",
384 "common.context_processors.next_summit",
385 "common.context_processors.login_redirect",
386 "common.context_processors.url_base",
387@@ -110,14 +100,12 @@
388 'django.middleware.locale.LocaleMiddleware',
389 'django.contrib.sessions.middleware.SessionMiddleware',
390 'django.contrib.auth.middleware.AuthenticationMiddleware',
391+ 'django.contrib.messages.middleware.MessageMiddleware',
392 )
393
394 ROOT_URLCONF = 'summit.urls'
395
396 TEMPLATE_DIRS = (
397- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
398- # Always use forward slashes, even on Windows.
399- # Don't forget to use absolute paths, not relative paths.
400 os.path.join(PROJECT_PATH, 'templates'),
401 os.path.join(PROJECT_PATH, 'common/templates'),
402 )
403@@ -125,6 +113,7 @@
404 INSTALLED_APPS = [
405 'django.contrib.auth',
406 'django.contrib.contenttypes',
407+ 'django.contrib.messages',
408 'django.contrib.sessions',
409 'django_openid_auth',
410 'django.contrib.admin',
411@@ -141,18 +130,13 @@
412 'django.contrib.auth.backends.ModelBackend',
413 )
414
415-# Should users be created when new OpenIDs are used to log in?
416+# OPENID Related settings
417+OPENID_STRICT_USERNAMES = True
418+OPENID_FOLLOW_RENAMES = True
419+OPENID_SREG_REQUIRED_FIELDS = ['email']
420 OPENID_CREATE_USERS = True
421-
422-# Can we reuse existing users?
423 OPENID_REUSE_USERS = True
424-
425-# When logging in again, should we overwrite user details based on
426-# data received via Simple Registration?
427 OPENID_UPDATE_DETAILS_FROM_SREG = True
428-
429-# If set, always use this as the identity URL rather than asking the
430-# user. This only makes sense if it is a server URL.
431 OPENID_SSO_SERVER_URL = 'https://login.ubuntu.com/'
432
433 # Tell django.contrib.auth to use the OpenID signin URLs.

Subscribers

People subscribed via source and target branches