Merge lp:~dholbach/developer-ubuntu-com/1525202 into lp:developer-ubuntu-com

Proposed by Daniel Holbach
Status: Superseded
Proposed branch: lp:~dholbach/developer-ubuntu-com/1525202
Merge into: lp:developer-ubuntu-com
Diff against target: 313 lines (+91/-26) (has conflicts)
7 files modified
Makefile (+16/-3)
developer_portal/blog/views.py (+15/-5)
developer_portal/management/commands/initdb.py (+25/-14)
developer_portal/settings.py (+6/-0)
locale/developer_portal.pot (+4/-4)
pip-cache-revno.txt (+4/-0)
requirements.txt (+21/-0)
Text conflict in Makefile
Text conflict in developer_portal/management/commands/initdb.py
Text conflict in developer_portal/settings.py
Text conflict in pip-cache-revno.txt
Text conflict in requirements.txt
To merge this branch: bzr merge lp:~dholbach/developer-ubuntu-com/1525202
Reviewer Review Type Date Requested Status
Ubuntu App Developer site developers Pending
Review via email: mp+280317@code.launchpad.net

This proposal supersedes a proposal from 2015-12-11.

This proposal has been superseded by a proposal from 2015-12-11.

To post a comment you must log in.
166. By Daniel Holbach

use parentheses around print statements, use {} for formatting

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-12-04 11:49:10 +0000
3+++ Makefile 2015-12-11 15:39:09 +0000
4@@ -14,8 +14,13 @@
5
6 swift-perms:
7 @echo "Setting up Swift bucket permissions"
8+<<<<<<< TREE
9 @if [ "${SWIFT_CONTAINER_NAME}" = "" ]; then echo "Using default upload container"; http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' devportal_uploaded; else http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' $(SWIFT_CONTAINER_NAME); fi
10 @if [ "${SWIFT_STATICCONTAINER_NAME}" = "" ]; then echo "Using default static container"; http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' devportal_static; else http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" swift post --read-acl '.r:*' $(SWIFT_STATICCONTAINER_NAME); fi
11+=======
12+ @if [ "${SWIFT_CONTAINER_NAME}" = "" ]; then echo "Using default upload container"; swift post --read-acl '.r:*' devportal_uploaded; else swift post --read-acl '.r:*' $(SWIFT_CONTAINER_NAME); fi
13+ @if [ "${SWIFT_STATICCONTAINER_NAME}" = "" ]; then echo "Using default static container"; swift post --read-acl '.r:*' devportal_static; else swift post --read-acl '.r:*' $(SWIFT_STATICCONTAINER_NAME); fi
14+>>>>>>> MERGE-SOURCE
15
16 update-apidocs:
17 if [ $(DATABASE_URL) ]; then DJANGO_SETTINGS_MODULE=charm_settings ./update_apidocs.sh > ${PWD}/../../logs/update_apidocs.log 2>${PWD}/../../logs/update_apidocs_errors.log; fi
18@@ -51,28 +56,36 @@
19 collectstatic: collectstatic.done
20 collectstatic.done:
21 @echo "Collecting static files"
22+<<<<<<< TREE
23 @http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" python manage.py collectstatic -v 0 --noinput --settings charm_settings 2>/dev/null
24+=======
25+ @python manage.py collectstatic -v 0 --noinput --settings charm_settings 2>/dev/null
26+>>>>>>> MERGE-SOURCE
27 @touch collectstatic.done
28
29 collectstatic.debug:
30 @echo "Debugging output from collectstatic"
31+<<<<<<< TREE
32 @http_proxy="${swift_proxy}" https_proxy="${swift_proxy}" python manage.py collectstatic -v 1 --noinput --settings charm_settings
33+=======
34+ @python manage.py collectstatic -v 1 --noinput --settings charm_settings
35+>>>>>>> MERGE-SOURCE
36
37 update-pip-cache:
38 @echo "Updating pip-cache"
39 rm -rf pip-cache
40- bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies pip-cache
41+ bzr branch lp:developer-ubuntu-com/dependencies pip-cache
42 pip install --exists-action=w --download pip-cache/ -r requirements.txt
43 bzr add pip-cache/*
44 bzr commit pip-cache/ -m 'automatically updated devportal requirements'
45- bzr push --directory pip-cache lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies
46+ bzr push --directory pip-cache lp:developer-ubuntu-com/dependencies
47 bzr revno pip-cache > pip-cache-revno.txt
48 rm -rf pip-cache
49 @echo "** Remember to commit pip-cache-revno.txt"
50
51 pip-cache:
52 @echo "Downloading pip-cache"
53- @bzr branch -r `cat pip-cache-revno.txt` lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies pip-cache
54+ @bzr branch -r `cat pip-cache-revno.txt` lp:developer-ubuntu-com/dependencies pip-cache
55
56 env: pip-cache
57 @echo "Creating virtualenv"
58
59=== modified file 'developer_portal/blog/views.py'
60--- developer_portal/blog/views.py 2015-12-04 11:49:10 +0000
61+++ developer_portal/blog/views.py 2015-12-11 15:39:09 +0000
62@@ -43,7 +43,9 @@
63 return super(MultiLangEntryYear, self).get(request, *args, **kwargs)
64
65 def get_dated_queryset(self, ordering=None, **lookup):
66- return super(MultiLangEntryYear, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
67+ if ordering:
68+ return super(MultiLangEntryYear, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
69+ return super(MultiLangEntryYear, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
70
71 class MultiLangEntryMonth(MultiLangMixin, EntryMonth):
72 def get(self, request, *args, **kwargs):
73@@ -51,7 +53,9 @@
74 return super(MultiLangEntryMonth, self).get(request, *args, **kwargs)
75
76 def get_dated_queryset(self, ordering=None, **lookup):
77- return super(MultiLangEntryMonth, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
78+ if ordering:
79+ return super(MultiLangEntryMonth, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
80+ return super(MultiLangEntryMonth, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
81
82 class MultiLangEntryWeek(MultiLangMixin, EntryWeek):
83 def get(self, request, *args, **kwargs):
84@@ -59,7 +63,9 @@
85 return super(MultiLangEntryWeek, self).get(request, *args, **kwargs)
86
87 def get_dated_queryset(self, ordering=None, **lookup):
88- return super(MultiLangEntryWeek, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
89+ if ordering:
90+ return super(MultiLangEntryWeek, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
91+ return super(MultiLangEntryWeek, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
92
93 class MultiLangEntryDay(MultiLangMixin, EntryDay):
94 def get(self, request, *args, **kwargs):
95@@ -67,7 +73,9 @@
96 return super(MultiLangEntryDay, self).get(request, *args, **kwargs)
97
98 def get_dated_queryset(self, ordering=None, **lookup):
99- return super(MultiLangEntryDay, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
100+ if ordering:
101+ return super(MultiLangEntryDay, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
102+ return super(MultiLangEntryDay, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
103
104 class MultiLangEntryToday(MultiLangMixin, EntryToday):
105 def get(self, request, *args, **kwargs):
106@@ -75,4 +83,6 @@
107 return super(MultiLangEntryToday, self).get(request, *args, **kwargs)
108
109 def get_dated_queryset(self, ordering=None, **lookup):
110- return super(MultiLangEntryToday, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
111+ if ordering:
112+ return super(MultiLangEntryToday, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
113+ return super(MultiLangEntryToday, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
114
115=== modified file 'developer_portal/management/commands/initdb.py'
116--- developer_portal/management/commands/initdb.py 2015-12-04 11:49:10 +0000
117+++ developer_portal/management/commands/initdb.py 2015-12-11 15:39:09 +0000
118@@ -1,17 +1,12 @@
119 #!/usr/bin/python
120
121 from django.core.management.base import BaseCommand
122-from optparse import make_option
123-
124 from django.conf import settings
125
126-import subprocess
127-import os
128-import sys
129-
130-from django.contrib.auth.models import User, Group, Permission
131-from django.contrib.contenttypes.models import ContentType
132+from django.contrib.auth.models import User, Permission
133 from cms.models.permissionmodels import PageUserGroup, GlobalPagePermission
134+from zinnia.models import Category
135+
136
137 class Command(BaseCommand):
138 help = "Make sure the Developer Portal database is set up properly."
139@@ -27,17 +22,18 @@
140 admin.save()
141
142 if hasattr(settings, 'ADMIN_GROUP') and settings.ADMIN_GROUP != "":
143- print "Configuring "+settings.ADMIN_GROUP+" group."
144- admins, created = PageUserGroup.objects.get_or_create(name=settings.ADMIN_GROUP, defaults={'created_by': admin})
145+ print("Configuring {} group.".format(settings.ADMIN_GROUP))
146+ admins, created = PageUserGroup.objects.get_or_create(
147+ name=settings.ADMIN_GROUP, defaults={'created_by': admin})
148 admins.permissions.add(*list(all_perms))
149
150 print "Configuring global permissions for group."
151 adminperms, created = GlobalPagePermission.objects.get_or_create(
152 # who:
153- group = admins,
154+ group=admins,
155
156 # what:
157- defaults = {
158+ defaults={
159 'can_change': True,
160 'can_add': True,
161 'can_delete': True,
162@@ -52,17 +48,24 @@
163
164 if hasattr(settings, 'EDITOR_GROUP') and settings.EDITOR_GROUP != "":
165 print "Configuring "+settings.EDITOR_GROUP+" group."
166+<<<<<<< TREE
167 editors, created = PageUserGroup.objects.get_or_create(name=settings.EDITOR_GROUP, defaults={'created_by': admin})
168 page_perms = Permission.objects.filter(content_type__app_label='cms', content_type__name='page')
169+=======
170+ editors, created = PageUserGroup.objects.get_or_create(
171+ name=settings.EDITOR_GROUP, defaults={'created_by': admin})
172+ page_perms = Permission.objects.filter(
173+ content_type__app_label='cms', content_type__model='page')
174+>>>>>>> MERGE-SOURCE
175 editors.permissions.add(*list(page_perms))
176
177 print "Configuring global permissions for group."
178 editorsperms, created = GlobalPagePermission.objects.get_or_create(
179 # who:
180- group = editors,
181+ group=editors,
182
183 # what:
184- defaults = {
185+ defaults={
186 'can_change': True,
187 'can_add': True,
188 'can_delete': True,
189@@ -74,3 +77,11 @@
190 }
191 )
192 editorsperms.sites.add(settings.SITE_ID)
193+
194+ print('Adding zinnia categories for the following: {}.'.format(
195+ ', '.join([a[0] for a in settings.LANGUAGES])))
196+ for lang in settings.LANGUAGES:
197+ if lang[1] == 'Simplified Chinese':
198+ Category.objects.get_or_create(title='Chinese', slug=lang[0])
199+ else:
200+ Category.objects.get_or_create(title=lang[1], slug=lang[0])
201
202=== modified file 'developer_portal/settings.py'
203--- developer_portal/settings.py 2015-12-04 16:09:27 +0000
204+++ developer_portal/settings.py 2015-12-11 15:39:09 +0000
205@@ -290,11 +290,17 @@
206 'toolbar': 'Zinnia',
207 },
208 }
209+<<<<<<< TREE
210
211 # Allow iframes in ckeditor
212 TEXT_ADDITIONAL_TAGS = ('iframe',)
213 TEXT_ADDITIONAL_ATTRIBUTES = ('scrolling', 'allowfullscreen', 'frameborder')
214
215+=======
216+TEXT_ADDITIONAL_TAGS = ('iframe',)
217+TEXT_ADDITIONAL_ATTRIBUTES = ('scrolling', 'allowfullscreen', 'frameborder')
218+
219+>>>>>>> MERGE-SOURCE
220 CMSPLUGIN_ZINNIA_APP_URLS = ['developer_portal.blog.urls']
221
222 REST_FRAMEWORK = {
223
224=== modified file 'locale/developer_portal.pot'
225--- locale/developer_portal.pot 2015-09-04 13:37:10 +0000
226+++ locale/developer_portal.pot 2015-12-11 15:39:09 +0000
227@@ -8,7 +8,7 @@
228 msgstr ""
229 "Project-Id-Version: PACKAGE VERSION\n"
230 "Report-Msgid-Bugs-To: \n"
231-"POT-Creation-Date: 2015-09-04 12:56+0000\n"
232+"POT-Creation-Date: 2015-10-24 03:11+0000\n"
233 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
234 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
235 "Language-Team: LANGUAGE <LL@li.org>\n"
236@@ -21,17 +21,17 @@
237 msgid "Raw HTML"
238 msgstr ""
239
240-#: developer_portal/models.py:24
241+#: developer_portal/models.py:26
242 msgid "Launchpad branch location, ie: lp:snappy/15.04"
243 msgstr ""
244
245-#: developer_portal/models.py:27
246+#: developer_portal/models.py:29
247 msgid ""
248 "Path alias we want to use for the docs, ie \"snappy/guides/15.04\" or "
249 "\"snappy/guides/latest\", etc."
250 msgstr ""
251
252-#: developer_portal/models.py:32
253+#: developer_portal/models.py:34
254 msgid "File name of doc to be used as index document, ie \"intro.md\""
255 msgstr ""
256
257
258=== modified file 'pip-cache-revno.txt'
259--- pip-cache-revno.txt 2015-12-04 11:49:10 +0000
260+++ pip-cache-revno.txt 2015-12-11 15:39:09 +0000
261@@ -1,1 +1,5 @@
262+<<<<<<< TREE
263 14
264+=======
265+17
266+>>>>>>> MERGE-SOURCE
267
268=== modified file 'requirements.txt'
269--- requirements.txt 2015-12-04 11:49:10 +0000
270+++ requirements.txt 2015-12-11 15:39:09 +0000
271@@ -1,3 +1,4 @@
272+<<<<<<< TREE
273 oslo.config==1.6.0
274 oslo.i18n==1.2.0
275 oslo.serialization==1.2.0
276@@ -8,17 +9,37 @@
277 Pillow==2.6.1
278 beautifulsoup4==4.4.0
279 cmsplugin-zinnia==0.6
280+=======
281+Django==1.8.7
282+django-template-debug==0.3.5
283+oslo.config==2.7.0
284+oslo.i18n==2.7.0
285+oslo.serialization==1.11.0
286+oslo.utils==2.8.0
287+Pillow==2.9.0
288+cmsplugin-zinnia==0.8
289+Markdown==2.6.5
290+beautifulsoup4==4.4.1
291+>>>>>>> MERGE-SOURCE
292 dj-database-url==0.3.0
293 django-admin-enhancer==0.1.3.1
294 django-appconf==0.6
295 django-blog-zinnia==0.14.2
296 django-ckeditor==4.4.7
297 django-ckeditor-updated==4.4.4
298+<<<<<<< TREE
299 django-classy-tags==0.5.1
300 django-cms==3.0.6
301 django-contrib-comments==1.5
302 django-meta==0.2.0
303 django-meta-mixin==0.1.1
304+=======
305+django-classy-tags==0.6.2
306+django-cms==3.2.0
307+django-contrib-comments==1.6.1
308+django-meta==0.3.1
309+django-meta-mixin==0.2.1
310+>>>>>>> MERGE-SOURCE
311 django-missing==0.1.13
312 django-mptt==0.7.4
313 django-parler==1.1.1

Subscribers

People subscribed via source and target branches