Skip to content

Commit 96d8890

Browse files
committed
⬆️ wagtail 4.1.9
1 parent 0211a6a commit 96d8890

File tree

4 files changed

+105
-92
lines changed

4 files changed

+105
-92
lines changed

eureka/main/management/commands/bootstrap_site_tree.py

Lines changed: 99 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
from django.core.management.base import (
22
BaseCommand, CommandError
33
)
4-
from eureka.main.blocks import VideoEmbedBlock
54
from eureka.main.models import (
65
HomePage, ImprovisationTypeIndexPage, ImprovisationTypePage,
76
EarTrainingIndexPage, EarTrainingLevelPage,
87
EarTrainingElementContainerPage, EarTrainingElementPage,
98
ImprovisationCombinationIndexPage, ImprovisationCombinationPage
109
)
11-
from wagtail.core.blocks import StreamBlock, StreamValue, RichTextBlock
1210
from wagtail.core.models import Page, Site
13-
from wagtail.core.rich_text import RichText
1411
from wagtailmenus.conf import settings
1512

1613
IMPROV_TYPE_LIST = [
@@ -33,73 +30,70 @@ def create_ear_training_elements(et_root_page, element_list):
3330
imp_type_page = EarTrainingElementPage(
3431
title=improv_type
3532
)
36-
imp_type_page.body = [('topic', {
37-
'title': 'Out of Tempo',
38-
'musical_elements': [{
39-
'element_title': 'Beginner',
40-
'content': StreamValue(
41-
stream_block=StreamBlock([
42-
('rich_text', RichTextBlock()),
43-
]),
44-
stream_data=[
45-
('rich_text', RichText('<p>TBD</p>')),
46-
]
47-
)
48-
}, {
49-
'element_title': 'Intermediate',
50-
'content': StreamValue(
51-
stream_block=StreamBlock([
52-
('rich_text', RichTextBlock()),
53-
]),
54-
stream_data=[
55-
('rich_text', RichText('<p>TBD</p>')),
56-
]
57-
)
58-
}, {
59-
'element_title': 'Advanced',
60-
'content': StreamValue(
61-
stream_block=StreamBlock([
62-
('rich_text', RichTextBlock()),
63-
]),
64-
stream_data=[
65-
('rich_text', RichText('<p>TBD</p>')),
66-
]
67-
)
68-
}]
69-
}), ('topic', {
70-
'title': 'In Tempo',
71-
'musical_elements': [{
72-
'element_title': 'Beginner',
73-
'content': StreamValue(
74-
stream_block=StreamBlock([
75-
('rich_text', RichTextBlock()),
76-
]),
77-
stream_data=[
78-
('rich_text', RichText('<p>TBD</p>')),
79-
]
80-
)
81-
}, {
82-
'element_title': 'Intermediate',
83-
'content': StreamValue(
84-
stream_block=StreamBlock([
85-
('rich_text', RichTextBlock()),
86-
]),
87-
stream_data=[
88-
('rich_text', RichText('<p>TBD</p>')),
89-
]
90-
)
91-
}, {
92-
'element_title': 'Advanced',
93-
'content': StreamValue(
94-
stream_block=StreamBlock([
95-
('rich_text', RichTextBlock()),
96-
]),
97-
stream_data=[
98-
('rich_text', RichText('<p>TBD</p>')),
99-
]
100-
)
101-
}]
102-
})]
33+
imp_type_page.body = [
34+
{
35+
'type': 'topic',
36+
'value': {
37+
'title': 'Out of Tempo',
38+
'musical_elements': [{
39+
'element_title': 'Beginner',
40+
'content': [
41+
{
42+
'type': 'rich_text',
43+
'value': '<p>TBD</p>'
44+
}
45+
]
46+
}, {
47+
'element_title': 'Intermediate',
48+
'content': [
49+
{
50+
'type': 'rich_text',
51+
'value': '<p>TBD</p>'
52+
}
53+
]
54+
}, {
55+
'element_title': 'Advanced',
56+
'content': [
57+
{
58+
'type': 'rich_text',
59+
'value': '<p>TBD</p>'
60+
}
61+
]
62+
}]
63+
}
64+
},
65+
{
66+
'type': 'topic',
67+
'value': {
68+
'title': 'In Tempo',
69+
'musical_elements': [{
70+
'element_title': 'Beginner',
71+
'content': [
72+
{
73+
'type': 'rich_text',
74+
'value': '<p>TBD</p>'
75+
}
76+
]
77+
}, {
78+
'element_title': 'Intermediate',
79+
'content': [
80+
{
81+
'type': 'rich_text',
82+
'value': '<p>TBD</p>'
83+
}
84+
]
85+
}, {
86+
'element_title': 'Advanced',
87+
'content': [
88+
{
89+
'type': 'rich_text',
90+
'value': '<p>TBD</p>'
91+
}
92+
]
93+
}]
94+
}
95+
}
96+
]
10397
element_container.add_child(instance=imp_type_page)
10498
imp_type_page.save_revision().publish()
10599

@@ -137,7 +131,10 @@ def handle(self, *args, **options):
137131
for improv_type in IMPROV_TYPE_LIST:
138132
improv_type_page = ImprovisationTypePage(
139133
title=improv_type,
140-
body=[('rich_text', RichText('<p>TBD</p>'))]
134+
body=[{
135+
'type': 'rich_text',
136+
'value': '<p>TBD</p>'
137+
}]
141138
)
142139
improv_type_index.add_child(instance=improv_type_page)
143140
improv_type_page.save_revision().publish()
@@ -155,7 +152,10 @@ def handle(self, *args, **options):
155152
title='Introduction to Ear Training One',
156153
tab_title='Ear Training One',
157154
show_in_menus=True,
158-
body=[('rich_text', RichText('<p>TBD</p>'))]
155+
body=[{
156+
'type': 'rich_text',
157+
'value': '<p>TBD</p>'
158+
}]
159159
)
160160
ear_training_index.add_child(instance=et_one)
161161
et_one.save_revision().publish()
@@ -173,19 +173,19 @@ def handle(self, *args, **options):
173173
'title': 'Out of tempo',
174174
'musical_elements': [{
175175
'element_title': 'Out of tempo with intervals',
176-
'content': StreamValue(
177-
stream_block=StreamBlock([
178-
('rich_text', RichTextBlock()),
179-
('video', VideoEmbedBlock()),
180-
]),
181-
stream_data=[
182-
('rich_text', RichText('<p>TBD</p>')),
183-
('video', {
176+
'content': [
177+
{
178+
'type': 'rich_text',
179+
'value': '<p>TBD</p>'
180+
},
181+
{
182+
'type': 'video',
183+
'value': {
184184
'url': YT_TEST_VIDEO,
185185
'description': 'A very fine video'
186-
}),
187-
]
188-
)
186+
}
187+
}
188+
]
189189
}]
190190
})]
191191
et_page.save_revision().publish()
@@ -195,7 +195,10 @@ def handle(self, *args, **options):
195195
title='Introduction to Ear Training Two',
196196
tab_title='Ear Training Two',
197197
show_in_menus=True,
198-
body=[('rich_text', RichText('<p>TBD</p>'))]
198+
body=[{
199+
'type': 'rich_text',
200+
'value': '<p>TBD</p>'
201+
}]
199202
)
200203
ear_training_index.add_child(instance=et_two)
201204
et_two.save_revision().publish()
@@ -212,7 +215,10 @@ def handle(self, *args, **options):
212215
title='Introduction to Ear Training Three',
213216
tab_title='Ear Training Three',
214217
show_in_menus=True,
215-
body=[('rich_text', RichText('<p>TBD</p>'))]
218+
body=[{
219+
'type': 'rich_text',
220+
'value': '<p>TBD</p>'
221+
}]
216222
)
217223
ear_training_index.add_child(instance=et_three)
218224
et_three.save_revision().publish()
@@ -229,7 +235,10 @@ def handle(self, *args, **options):
229235
title='Introduction to Ear Training Four',
230236
tab_title='Ear Training Four',
231237
show_in_menus=True,
232-
body=[('rich_text', RichText('<p>TBD</p>'))]
238+
body=[{
239+
'type': 'rich_text',
240+
'value': '<p>TBD</p>'
241+
}]
233242
)
234243
ear_training_index.add_child(instance=et_four)
235244
et_four.save_revision().publish()
@@ -255,7 +264,10 @@ def handle(self, *args, **options):
255264
combo_page = ImprovisationCombinationPage(
256265
title=i,
257266
show_in_menus=True,
258-
body=[('rich_text', RichText('<p>TBD</p>'))]
267+
body=[{
268+
'type': 'rich_text',
269+
'value': '<p>TBD</p>'
270+
}]
259271
)
260272
improv_combo_index.add_child(instance=combo_page)
261273
combo_page.save_revision().publish()

eureka/main/tests/test_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
EarTrainingElementContainerPage, EarTrainingLevelPage,
33
EarTrainingElementPage, pack_nav_pages
44
)
5-
from wagtail.tests.utils import WagtailPageTests
5+
from wagtail.tests.utils import WagtailPageTestCase
66

77

8-
class PageTest(WagtailPageTests):
8+
class PageTest(WagtailPageTestCase):
99
def test_ear_training_element_container_page(self):
1010
"""Test that requests to an ear training container page
1111
redirect to its first child"""

eureka/main/tests/test_views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
EarTrainingElementPage, ImprovisationCombinationIndexPage,
55
ImprovisationCombinationPage
66
)
7-
from wagtail.tests.utils import WagtailPageTests
7+
from wagtail.tests.utils import WagtailPageTestCase
88

99

10-
class ViewTest(WagtailPageTests):
10+
class ViewTest(WagtailPageTestCase):
1111
"""These test check that the page can be routed and can
1212
render templates cleanly"""
1313
def test_smoketest(self):

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ django-contact-us==1.1.0
9696
entrypoints==0.4
9797

9898
# wagtail requirements
99-
wagtail==4.0.4
99+
wagtail==4.1.9
100100
django-modelcluster>=6.0,<7.0
101101
django-permissionedforms>=0.1,<1.0
102102
django-taggit>=5.0.1,<7.0
@@ -116,6 +116,7 @@ xlsxwriter>=1.2.8,<4.0
116116
tablib[xls,xlsx]>=0.14.0
117117
anyascii>=0.1.5
118118
telepath>=0.1.1,<1
119+
openpyxl==3.1.5
119120

120121
# wagtail 4.0 dependency
121122
standard-imghdr==3.13.0; python_version>"3.12"

0 commit comments

Comments
 (0)