Skip to content

Commit 1c9fb14

Browse files
committed
Django 3 upgrade.
Delete deployed squashed migrations. Remove tests for removed migrations. Remove some deprecated calls.
1 parent d5dcac3 commit 1c9fb14

File tree

172 files changed

+477
-3662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+477
-3662
lines changed

.github/workflows/deploytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ jobs:
8282
sudo apt-get update -y
8383
sudo apt-get install -y gettext
8484
- name: Test Django makemessages
85-
run: python contentcuration/manage.py makemessages
85+
run: python contentcuration/manage.py makemessages --all

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ i18n-extract-frontend:
6565

6666
i18n-extract-backend:
6767
# generate backend messages
68-
cd contentcuration && python manage.py makemessages
69-
# workaround for Django 1.11 makemessages spitting out an invalid English translation file
70-
python bin/fix_django_messages.py
68+
cd contentcuration && python manage.py makemessages --all
7169

7270
i18n-extract: i18n-extract-frontend i18n-extract-backend
7371

bin/fix_django_messages.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

contentcuration/contentcuration/api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""
22
This module contains utility functions used by API endpoints.
33
"""
4-
from future import standard_library
5-
standard_library.install_aliases()
64
import hashlib
75
import logging
86
import os

contentcuration/contentcuration/catalog_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# flake8: noqa
22
from .production_settings import * # noqa
33

4-
LANGUAGES += (("ar", ugettext("Arabic")),) # noqa
4+
LANGUAGES += (("ar", gettext("Arabic")),) # noqa
55

66
LIBRARY_MODE = True
77
SITE_READ_ONLY = True

contentcuration/contentcuration/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def wrap(request, *args, **kwargs):
2525

2626
def is_admin(function):
2727
def wrap(request, *args, **kwargs):
28-
if not request.user.is_anonymous() and request.user.is_admin:
28+
if not request.user.is_anonymous and request.user.is_admin:
2929
return function(request, *args, **kwargs)
3030

3131
return render(request, "unauthorized.html", status=403)

contentcuration/contentcuration/middleware/db_readonly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.http import HttpResponseBadRequest
2-
from django.utils.translation import ugettext as _
2+
from django.utils.translation import gettext as _
33

44
try:
55
# Django 1.10+

contentcuration/contentcuration/migrations/0001_initial.py

Lines changed: 0 additions & 299 deletions
This file was deleted.

contentcuration/contentcuration/migrations/0001_squashed_0094_auto_20180910_2342.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
class Migration(migrations.Migration):
1919

20-
replaces = [('contentcuration', '0001_initial'), ('contentcuration', '0002_language_readable_name'), ('contentcuration', '0003_user_clipboard_tree'), ('contentcuration', '0004_auto_20160720_1220'), ('contentcuration', '0005_auto_20160816_1720'), ('contentcuration', '0006_contentnode_published'), ('contentcuration', '0005_formatpreset_thumbnail'), ('contentcuration', '0007_merge'), ('contentcuration', '0008_channel_published'), ('contentcuration', '0009_remove_channel_published'), ('contentcuration', '0010_auto_20160830_1740'), ('contentcuration', '0011_file_source_url'), ('contentcuration', '0012_auto_20160907_1444'), ('contentcuration', '0013_contentnode_node_id'), ('contentcuration', '0014_channel_language'), ('contentcuration', '0015_auto_20160914_1640'), ('contentcuration', '0016_auto_20160915_1206'), ('contentcuration', '0015_auto_20160916_1349'), ('contentcuration', '0017_merge'), ('contentcuration', '0018_auto_20160919_1533'), ('contentcuration', '0019_auto_20160919_1559'), ('contentcuration', '0020_auto_20160919_1617'), ('contentcuration', '0021_auto_20160919_1620'), ('contentcuration', '0022_auto_20160920_1119'), ('contentcuration', '0023_contentnode_extra_fields'), ('contentcuration', '0024_auto_20160920_1136'), ('contentcuration', '0025_auto_20160921_1356'), ('contentcuration', '0026_merge'), ('contentcuration', '0027_auto_20160926_0945'), ('contentcuration', '0028_auto_20160926_1527'), ('contentcuration', '0029_auto_20161005_0933'), ('contentcuration', '0030_auto_20161005_0935'), ('contentcuration', '0031_auto_20161010_1143'), ('contentcuration', '0032_auto_20161010_1202'), ('contentcuration', '0033_auto_20161012_1344'), ('contentcuration', '0034_auto_20161014_1509'), ('contentcuration', '0035_auto_20161018_1438'), ('contentcuration', '0036_auto_20161018_1536'), ('contentcuration', '0037_remove_contentnode_author'), ('contentcuration', '0038_contentnode_author'), ('contentcuration', '0039_auto_20161101_1555'), ('contentcuration', '0040_file_assessment_item'), ('contentcuration', '0041_channel_previous_tree'), ('contentcuration', '0042_auto_20161206_1641'), ('contentcuration', '0043_channel_viewers'), ('contentcuration', '0042_auto_20161205_1622'), ('contentcuration', '0044_merge'), ('contentcuration', '0045_invitation_viewonly'), ('contentcuration', '0046_auto_20161222_1210'), ('contentcuration', '0042_auto_20161130_1446'), ('contentcuration', '0043_merge'), ('contentcuration', '0044_auto_20170119_1033'), ('contentcuration', '0045_auto_20170119_1429'), ('contentcuration', '0047_merge'), ('contentcuration', '0048_auto_20170119_1732'), ('contentcuration',
21-
'0049_merge'), ('contentcuration', '0050_auto_20170125_1018'), ('contentcuration', '0051_auto_20170126_1633'), ('contentcuration', '0052_auto_20170201_1155'), ('contentcuration', '0051_auto_20170126_1012'), ('contentcuration', '0053_merge'), ('contentcuration', '0054_language_native_name'), ('contentcuration', '0052_auto_20170130_0931'), ('contentcuration', '0055_merge'), ('contentcuration', '0056_assessmentitem_randomize'), ('contentcuration', '0057_auto_20170223_1558'), ('contentcuration', '0058_auto_20170223_1636'), ('contentcuration', '0057_assessmentitem_deleted'), ('contentcuration', '0059_merge'), ('contentcuration', '0059_channelresourcesize'), ('contentcuration', '0059_auto_20170402_1504'), ('contentcuration', '0060_merge'), ('contentcuration', '0061_auto_20170327_1344'), ('contentcuration', '0062_merge'), ('contentcuration', '0063_auto_20170411_1249'), ('contentcuration', '0064_auto_20170411_1328'), ('contentcuration', '0065_auto_20170411_1609'), ('contentcuration', '0066_auto_20170412_0015'), ('contentcuration', '0067_auto_20170427_1442'), ('contentcuration', '0068_auto_20170519_1337'), ('contentcuration', '0069_channel_preferences'), ('contentcuration', '0068_auto_20170509_1456'), ('contentcuration', '0070_merge'), ('contentcuration', '0069_auto_20170605_2122'), ('contentcuration', '0071_merge'), ('contentcuration', '0072_contentnode_language'), ('contentcuration', '0072_auto_20170731_2153'), ('contentcuration', '0073_merge'), ('contentcuration', '0074_channel_priority'), ('contentcuration', '0073_auto_20170911_1837'), ('contentcuration', '0075_merge'), ('contentcuration', '0076_auto_20171003_1847'), ('contentcuration', '0076_auto_20170927_1817'), ('contentcuration', '0077_merge'), ('contentcuration', '0078_auto_20171024_1207'), ('contentcuration', '0079_contentnode_publishing'), ('contentcuration', '0080_user_information'), ('contentcuration', '0081_auto_20180314_1631'), ('contentcuration', '0080_auto_20180314_1756'), ('contentcuration', '0082_merge'), ('contentcuration', '0079_auto_20180326_1448'), ('contentcuration', '0083_merge'), ('contentcuration', '0084_auto_20180329_1051'), ('contentcuration', '0085_user_policies'), ('contentcuration', '0086_auto_20180626_1055'), ('contentcuration', '0085_auto_20180605_1714'), ('contentcuration', '0087_merge'), ('contentcuration', '0088_auto_20180705_2007'), ('contentcuration', '0089_auto_20180706_2242'), ('contentcuration', '0091_auto_20180724_2243'), ('contentcuration', '0092_auto_20180731_1024'), ('contentcuration', '0093_auto_20180831_0745'), ('contentcuration', '0094_auto_20180910_2342')]
22-
2320
initial = True
2421

2522
dependencies = [
@@ -859,4 +856,15 @@ class Migration(migrations.Migration):
859856
field=models.CharField(choices=[('mp4', 'MP4 Video'), ('vtt', 'VTT Subtitle'), ('mp3', 'MP3 Audio'), ('pdf', 'PDF Document'), ('jpg', 'JPG Image'), ('jpeg', 'JPEG Image'), ('png', 'PNG Image'), ('gif', 'GIF Image'), (
860857
'json', 'JSON'), ('svg', 'SVG Image'), ('perseus', 'Perseus Exercise'), ('graphie', 'Graphie Exercise'), ('zip', 'HTML5 Zip'), ('epub', 'ePub Document')], max_length=40, primary_key=True, serialize=False),
861858
),
859+
migrations.CreateModel(
860+
name='ChannelSet',
861+
fields=[
862+
('id', contentcuration.models.UUIDField(default=uuid.uuid4, max_length=32, primary_key=True, serialize=False)),
863+
('name', models.CharField(blank=True, max_length=200)),
864+
('description', models.CharField(blank=True, max_length=400)),
865+
('public', models.BooleanField(db_index=True, default=False)),
866+
('editors', models.ManyToManyField(blank=True, help_text='Users with edit rights', related_name='channel_sets', to=settings.AUTH_USER_MODEL, verbose_name='editors')),
867+
('secret_token', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='channel_sets', to='contentcuration.SecretToken')),
868+
],
869+
),
862870
]

contentcuration/contentcuration/migrations/0002_language_readable_name.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)