Ubuntu Pastebin

Paste from dholbach at Mon, 18 Jan 2016 18:28:59 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
=== modified file 'Makefile'
--- Makefile	2016-01-12 14:24:40 +0000
+++ Makefile	2016-01-18 18:27:57 +0000
@@ -61,18 +61,18 @@
 update-pip-cache:
 	@echo "Updating pip-cache"
 	rm -rf pip-cache
-	bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies pip-cache
+	bzr branch lp:developer-ubuntu-com/dependencies pip-cache
 	pip install --exists-action=w --download pip-cache/ -r requirements.txt
 	bzr add pip-cache/* 
 	bzr commit pip-cache/ -m 'automatically updated devportal requirements'
-	bzr push --directory pip-cache lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies
+	bzr push --directory pip-cache lp:developer-ubuntu-com/dependencies 
 	bzr revno pip-cache > pip-cache-revno.txt
 	rm -rf pip-cache
 	@echo "** Remember to commit pip-cache-revno.txt"
 
 pip-cache:
 	@echo "Downloading pip-cache"
-	@bzr branch -r `cat pip-cache-revno.txt` lp:~developer-ubuntu-com-dev/developer-ubuntu-com/dependencies pip-cache
+	@bzr branch -r `cat pip-cache-revno.txt` lp:developer-ubuntu-com/dependencies pip-cache
 
 env: pip-cache
 	@echo "Creating virtualenv"

=== modified file 'developer_portal/blog/views.py'
--- developer_portal/blog/views.py	2015-12-08 10:25:29 +0000
+++ developer_portal/blog/views.py	2016-01-18 18:23:04 +0000
@@ -43,7 +43,9 @@
         return super(MultiLangEntryYear, self).get(request, *args, **kwargs)
 
     def get_dated_queryset(self, ordering=None, **lookup):
-        return super(MultiLangEntryYear, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
+        if ordering:
+            return super(MultiLangEntryYear, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
+        return super(MultiLangEntryYear, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
 
 class MultiLangEntryMonth(MultiLangMixin, EntryMonth):
     def get(self, request, *args, **kwargs):
@@ -51,7 +53,9 @@
         return super(MultiLangEntryMonth, self).get(request, *args, **kwargs)
 
     def get_dated_queryset(self, ordering=None, **lookup):
-        return super(MultiLangEntryMonth, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
+        if ordering:
+            return super(MultiLangEntryMonth, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
+        return super(MultiLangEntryMonth, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
 
 class MultiLangEntryWeek(MultiLangMixin, EntryWeek):
     def get(self, request, *args, **kwargs):
@@ -59,7 +63,9 @@
         return super(MultiLangEntryWeek, self).get(request, *args, **kwargs)
 
     def get_dated_queryset(self, ordering=None, **lookup):
-        return super(MultiLangEntryWeek, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
+        if ordering:
+            return super(MultiLangEntryWeek, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
+        return super(MultiLangEntryWeek, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
 
 class MultiLangEntryDay(MultiLangMixin, EntryDay):
     def get(self, request, *args, **kwargs):
@@ -67,7 +73,9 @@
         return super(MultiLangEntryDay, self).get(request, *args, **kwargs)
 
     def get_dated_queryset(self, ordering=None, **lookup):
-        return super(MultiLangEntryDay, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
+        if ordering:
+            return super(MultiLangEntryDay, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
+        return super(MultiLangEntryDay, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)
 
 class MultiLangEntryToday(MultiLangMixin, EntryToday):
     def get(self, request, *args, **kwargs):
@@ -75,4 +83,6 @@
         return super(MultiLangEntryToday, self).get(request, *args, **kwargs)
 
     def get_dated_queryset(self, ordering=None, **lookup):
-        return super(MultiLangEntryToday, self).get_dated_queryset(ordering, **lookup).filter(categories__slug=self.language)
+        if ordering:
+            return super(MultiLangEntryToday, self).get_dated_queryset(**lookup).filter(categories__slug=self.language).order_by(ordering)
+        return super(MultiLangEntryToday, self).get_dated_queryset(**lookup).filter(categories__slug=self.language)

=== modified file 'developer_portal/management/commands/initdb.py'
--- developer_portal/management/commands/initdb.py	2015-12-08 10:25:29 +0000
+++ developer_portal/management/commands/initdb.py	2016-01-18 18:24:04 +0000
@@ -1,17 +1,12 @@
 #!/usr/bin/python
 
 from django.core.management.base import BaseCommand
-from optparse import make_option
-
 from django.conf import settings
 
-import subprocess
-import os
-import sys
-
-from django.contrib.auth.models import User, Group, Permission
-from django.contrib.contenttypes.models import ContentType
+from django.contrib.auth.models import User, Permission
 from cms.models.permissionmodels import PageUserGroup, GlobalPagePermission
+from zinnia.models import Category
+
 
 class Command(BaseCommand):
     help = "Make sure the Developer Portal database is set up properly."
@@ -20,24 +15,25 @@
 
         all_perms = Permission.objects.filter()
 
-        print "Creating admin user."
+        print("Creating admin user.")
         admin, created = User.objects.get_or_create(username='system')
         admin.is_staff = True
         admin.is_superuser = True
         admin.save()
 
         if hasattr(settings, 'ADMIN_GROUP') and settings.ADMIN_GROUP != "":
-            print "Configuring "+settings.ADMIN_GROUP+" group."
-            admins, created = PageUserGroup.objects.get_or_create(name=settings.ADMIN_GROUP, defaults={'created_by': admin})
+            print("Configuring {} group.".format(settings.ADMIN_GROUP))
+            admins, created = PageUserGroup.objects.get_or_create(
+                name=settings.ADMIN_GROUP, defaults={'created_by': admin})
             admins.permissions.add(*list(all_perms))
 
-            print "Configuring global permissions for group."
+            print("Configuring global permissions for group.")
             adminperms, created = GlobalPagePermission.objects.get_or_create(
                 # who:
-                group = admins,
+                group=admins,
 
                 # what:
-                defaults = {
+                defaults={
                     'can_change': True,
                     'can_add': True,
                     'can_delete': True,
@@ -51,18 +47,20 @@
             adminperms.sites.add(settings.SITE_ID)
 
         if hasattr(settings, 'EDITOR_GROUP') and settings.EDITOR_GROUP != "":
-            print "Configuring "+settings.EDITOR_GROUP+" group."
-            editors, created = PageUserGroup.objects.get_or_create(name=settings.EDITOR_GROUP, defaults={'created_by': admin})
-            page_perms = Permission.objects.filter(content_type__app_label='cms', content_type__name='page')
+            print("Configuring {} group.".format(settings.EDITOR_GROUP))
+            editors, created = PageUserGroup.objects.get_or_create(
+                name=settings.EDITOR_GROUP, defaults={'created_by': admin})
+            page_perms = Permission.objects.filter(
+                content_type__app_label='cms', content_type__model='page')
             editors.permissions.add(*list(page_perms))
 
-            print "Configuring global permissions for group."
+            print("Configuring global permissions for group.")
             editorsperms, created = GlobalPagePermission.objects.get_or_create(
                 # who:
-                group = editors,
+                group=editors,
 
                 # what:
-                defaults = {
+                defaults={
                     'can_change': True,
                     'can_add': True,
                     'can_delete': True,
@@ -74,3 +72,11 @@
                 }
             )
             editorsperms.sites.add(settings.SITE_ID)
+
+        print('Adding zinnia categories for the following: {}.'.format(
+            ', '.join([a[0] for a in settings.LANGUAGES])))
+        for lang in settings.LANGUAGES:
+            if lang[1] == 'Simplified Chinese':
+                Category.objects.get_or_create(title='Chinese', slug=lang[0])
+            else:
+                Category.objects.get_or_create(title=lang[1], slug=lang[0])

=== modified file 'developer_portal/settings.py'
--- developer_portal/settings.py	2015-12-08 10:25:29 +0000
+++ developer_portal/settings.py	2016-01-18 18:28:19 +0000
@@ -318,6 +318,23 @@
     #'PAGINATE_BY': 10,
 }
 
+MIGRATION_MODULES = {
+    'cms': 'cms.migrations',
+    'cmsplugin_zinnia': 'cmsplugin_zinnia.migrations',
+    'djangocms_link': 'djangocms_link.migrations',
+    'djangocms_picture': 'djangocms_picture.migrations',
+    'djangocms_snippet': 'djangocms_snippet.migrations',
+    'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations',
+    'djangocms_video': 'djangocms_video.migrations',
+    'django_comments': 'django_comments.migrations',
+    'menus': 'menus.migrations',
+    'rest_framework.authtoken': 'rest_framework.authtoken.migrations',
+    'reversion': 'reversion.migrations',
+    'tagging': 'tagging.migrations',
+    'taggit': 'taggit.migrations',
+    'zinnia': 'zinnia.migrations',
+}
+
 LOGGING = {
     'version': 1,
     'disable_existing_loggers': False,

=== modified file 'pip-cache-revno.txt'
--- pip-cache-revno.txt	2015-12-08 10:25:29 +0000
+++ pip-cache-revno.txt	2016-01-18 18:24:36 +0000
@@ -1,1 +1,1 @@
-14
+20

=== modified file 'requirements.txt'
--- requirements.txt	2015-12-08 10:25:29 +0000
+++ requirements.txt	2016-01-18 18:25:06 +0000
@@ -1,53 +1,52 @@
-oslo.config==1.6.0
-oslo.i18n==1.2.0
-oslo.serialization==1.2.0
-oslo.utils==1.2.0
-Django==1.6.8
-Markdown==2.6.2
-South==1.0.1
-Pillow==2.6.1
-beautifulsoup4==4.4.0
-cmsplugin-zinnia==0.6
+Django==1.8.8
+django-template-debug==0.3.5
+oslo.config==3.1.0
+oslo.i18n==3.1.0
+oslo.serialization==2.1.0
+oslo.utils==3.2.0
+Pillow==2.9.0
+cmsplugin-zinnia==0.8
+Markdown==2.6.5
+beautifulsoup4==4.4.1
 dj-database-url==0.3.0
-django-admin-enhancer==0.1.3.1
-django-appconf==0.6
-django-blog-zinnia==0.14.2
-django-ckeditor==4.4.7
+django-admin-enhancer==1.0.0
+django-appconf==1.0.1
+django-blog-zinnia==0.15.2
+django-ckeditor==5.0.2
 django-ckeditor-updated==4.4.4
-django-classy-tags==0.5.1
-django-cms==3.0.6
-django-contrib-comments==1.5
-django-meta==0.2.0
-django-meta-mixin==0.1.1
-django-missing==0.1.13
-django-mptt==0.7.4
-django-parler==1.1.1
-django-polymorphic==0.6
-django-reversion==1.8.4
-django-sekizai==0.7
+django-classy-tags==0.7.0
+django-cms==3.2.0
+django-contrib-comments==1.6.2
+django-meta==0.3.1
+django-meta-mixin==0.2.1
+django-missing==0.1.15
+django-parler==1.6
+django-polymorphic==0.8.1
+django-reversion==1.9.3
+django-sekizai==0.9.0
 django-swiftstorage==1.1.0
-django-tagging==0.3.3
-django-taggit==0.12.2
-django-taggit-autosuggest==0.2.5
+django-tagging==0.4
+django-taggit==0.17.6
+django-taggit-autosuggest==0.2.8
 django-taggit-templatetags==0.2.5
 django-templatetag-sugar==1.0
 django-xmlrpc==0.1.5
-djangocms-admin-style==0.2.2
-djangocms-link==1.5
-djangocms-picture==0.1
-djangocms-snippet==1.3
-djangocms-text-ckeditor==2.4.2
+djangocms-admin-style==1.0.8
+djangocms-link==1.7.1
+djangocms-picture==0.2.0
+djangocms-snippet==1.7.1
+djangocms-text-ckeditor==2.8.1
 djangocms-utils==0.9.5
-djangocms-video==0.1
-python-keystoneclient==0.11.2
-python-swiftclient==2.3.1
-pytz==2014.7
+djangocms-video==0.2.0
+python-keystoneclient==1.3.3
+python-swiftclient==2.6.0
+pytz==2015.7
 simple-translation==0.8.6
-simplejson==3.6.5
+simplejson==3.8.1
 wsgiref==0.1.2
-zinnia-wysiwyg-ckeditor==1.1
-Pygments==1.6
+zinnia-wysiwyg-ckeditor==1.3
+Pygments==2.0.2
 django-pygments==0.1
-django-openid-auth==0.5
-python-openid==2.2.4
-djangorestframework==3.0.4
+django-openid-auth==0.7
+python-openid==2.2.5
+djangorestframework==3.3.2
Download as text