Skip to content

Commit 238f6b9

Browse files
authored
Merge branch 'develop' into chore/docker-compose-remove-container-name
2 parents 3a57b40 + da6811c commit 238f6b9

File tree

13 files changed

+722
-683
lines changed

13 files changed

+722
-683
lines changed

config/settings/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
For the full list of settings and their values, see
1010
https://docs.djangoproject.com/en/3.1/ref/settings/
1111
"""
12+
1213
import os
1314

1415
from sysconfig import get_path
@@ -73,7 +74,6 @@
7374
"wagtailfontawesomesvg",
7475
"wagtailmedia",
7576
"wagtail.contrib.settings",
76-
"wagtail.contrib.styleguide",
7777
"generic_chooser",
7878
"wagtailmetadata",
7979
"modelcluster",

etna/articles/models.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class ArticleIndexPage(BasePageWithIntro):
136136
[("featuredpages", FeaturedCollectionBlock())],
137137
blank=True,
138138
null=True,
139-
use_json_field=True,
140139
)
141140

142141
api_fields = BasePageWithIntro.api_fields + [
@@ -212,9 +211,7 @@ class ArticlePage(
212211
The ArticlePage model.
213212
"""
214213

215-
body = StreamField(
216-
ArticlePageStreamBlock, blank=True, null=True, use_json_field=True
217-
)
214+
body = StreamField(ArticlePageStreamBlock, blank=True, null=True)
218215

219216
# DataLayerMixin overrides
220217
gtm_content_group = "Explore the collection"
@@ -372,9 +369,7 @@ class FocusedArticlePage(
372369
The FocusedArticlePage model.
373370
"""
374371

375-
body = StreamField(
376-
ArticlePageStreamBlock, blank=True, null=True, use_json_field=True
377-
)
372+
body = StreamField(ArticlePageStreamBlock, blank=True, null=True)
378373

379374
# DataLayerMixin overrides
380375
gtm_content_group = "Explore the collection"
@@ -595,7 +590,6 @@ class RecordArticlePage(
595590
max_num=1,
596591
blank=True,
597592
null=True,
598-
use_json_field=True,
599593
)
600594

601595
# DataLayerMixin overrides

etna/collections/models.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ExplorerIndexPage(AlertMixin, BasePageWithIntro):
8484
explorer.
8585
"""
8686

87-
body = StreamField(ExplorerIndexPageStreamBlock, blank=True, use_json_field=True)
87+
body = StreamField(ExplorerIndexPageStreamBlock, blank=True)
8888

8989
articles_title = models.CharField(
9090
max_length=100,
@@ -115,7 +115,6 @@ class ExplorerIndexPage(AlertMixin, BasePageWithIntro):
115115
[("featuredarticles", FeaturedArticlesBlock())],
116116
blank=True,
117117
null=True,
118-
use_json_field=True,
119118
)
120119

121120
content_panels = BasePageWithIntro.content_panels + [
@@ -169,7 +168,7 @@ class TopicExplorerIndexPage(RequiredHeroImageMixin, BasePageWithIntro):
169168
This page lists all child TopicExplorerPages
170169
"""
171170

172-
body = StreamField(TopicIndexPageStreamBlock, blank=True, use_json_field=True)
171+
body = StreamField(TopicIndexPageStreamBlock, blank=True)
173172

174173
content_panels = (
175174
BasePageWithIntro.content_panels
@@ -250,7 +249,7 @@ class Meta:
250249
"articles.RecordArticlePage", blank=True, null=True, on_delete=models.SET_NULL
251250
)
252251

253-
body = StreamField(TopicExplorerPageStreamBlock, blank=True, use_json_field=True)
252+
body = StreamField(TopicExplorerPageStreamBlock, blank=True)
254253

255254
skos_id = models.CharField(
256255
unique=True,
@@ -400,7 +399,7 @@ class TimePeriodExplorerIndexPage(RequiredHeroImageMixin, BasePageWithIntro):
400399
This page lists all child TimePeriodExplorerPage
401400
"""
402401

403-
body = StreamField(TopicIndexPageStreamBlock, blank=True, use_json_field=True)
402+
body = StreamField(TopicIndexPageStreamBlock, blank=True)
404403

405404
content_panels = (
406405
BasePageWithIntro.content_panels
@@ -479,9 +478,7 @@ class Meta:
479478
featured_record_article = models.ForeignKey(
480479
"articles.RecordArticlePage", blank=True, null=True, on_delete=models.SET_NULL
481480
)
482-
body = StreamField(
483-
TimePeriodExplorerPageStreamBlock, blank=True, use_json_field=True
484-
)
481+
body = StreamField(TimePeriodExplorerPageStreamBlock, blank=True)
485482
start_year = models.IntegerField(blank=False)
486483
end_year = models.IntegerField(blank=False)
487484
content_panels = (

etna/feedback/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ class FeedbackPrompt(DraftStateMixin, RevisionMixin, ClusterableModel):
113113
)
114114
response_options = StreamField(
115115
[("option", ResponseOptionBlock())],
116-
use_json_field=True,
117116
verbose_name=_("response options"),
118117
)
119118
thank_you_heading = models.CharField(

etna/generic_pages/models.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88

99
class GeneralPage(BasePage):
10-
body = StreamField(
11-
GeneralPageStreamBlock, blank=True, null=True, use_json_field=True
12-
)
10+
body = StreamField(GeneralPageStreamBlock, blank=True, null=True)
1311
content_panels = BasePage.content_panels + [
1412
FieldPanel("body"),
1513
]

etna/home/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class HomePage(AlertMixin, BasePageWithIntro):
12-
body = StreamField(HomePageStreamBlock, blank=True, null=True, use_json_field=True)
12+
body = StreamField(HomePageStreamBlock, blank=True, null=True)
1313

1414
content_panels = BasePageWithIntro.content_panels + [
1515
FieldPanel("body"),

etna/records/tests/test_views.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@ def test_back_to_search_render_with_catalogue_search_within_expiry(self):
796796

797797
session = self.client.session
798798
session["back_to_search_url"] = search_url_gen_html_resp
799-
session[
800-
"back_to_search_url_timestamp"
801-
] = self.back_to_search_url_timestamp.isoformat()
799+
session["back_to_search_url_timestamp"] = (
800+
self.back_to_search_url_timestamp.isoformat()
801+
)
802802
session.save()
803803

804804
response = self.client.get(self.record_detail_url)
@@ -850,9 +850,9 @@ def test_new_search_render_with_session(self):
850850

851851
session = self.client.session
852852
session["back_to_search_url"] = browser_search_url
853-
session[
854-
"back_to_search_url_timestamp"
855-
] = self.back_to_search_url_timestamp.isoformat()
853+
session["back_to_search_url_timestamp"] = (
854+
self.back_to_search_url_timestamp.isoformat()
855+
)
856856
session.save()
857857

858858
response = self.client.get(self.record_detail_url)

etna/search/tests/test_search_tags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def setUp(self):
206206
)
207207

208208
def test_render_sort_by_input_input_id(self):
209-
expected_html = '<select name="sort_by" class="search-sort-view__form-select" id="id_sort_by_somevalue">'
209+
expected_html = '<select name="sort_by" class="search-sort-view__form-select" id="id_sort_by_somevalue" aria-invalid="true">'
210210
self.assertIn(
211211
expected_html, render_sort_by_input(self.form, id_suffix="somevalue")
212212
)

etna/search/views.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ def set_session_info(self) -> None:
378378
"""
379379

380380
self.request.session["back_to_search_url"] = self.request.get_full_path()
381-
self.request.session[
382-
"back_to_search_url_timestamp"
383-
] = timezone.now().isoformat()
381+
self.request.session["back_to_search_url_timestamp"] = (
382+
timezone.now().isoformat()
383+
)
384384
return None
385385

386386

etna/whatson/models.py

-3
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,11 @@ class WhatsOnPage(BasePageWithIntro):
292292
[("promoted_links", WhatsOnPromotedLinksBlock())],
293293
blank=True,
294294
max_num=1,
295-
use_json_field=True,
296295
)
297296
large_card_links = StreamField(
298297
[("large_card_links", LargeCardLinksBlock())],
299298
blank=True,
300299
max_num=1,
301-
use_json_field=True,
302300
)
303301

304302
def serve(self, request):
@@ -1072,7 +1070,6 @@ class ExhibitionPage(ArticleTagMixin, TopicalPageMixin, BasePageWithIntro):
10721070
[("relatedarticles", RelatedArticlesBlock())],
10731071
blank=True,
10741072
null=True,
1075-
use_json_field=True,
10761073
)
10771074

10781075
# Promote tab

lint-requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
flake8==6.1.0
2-
isort==5.12.0
3-
black==23.11.0
1+
flake8==7.0.0
2+
isort==5.13.2
3+
black==24.2.0

0 commit comments

Comments
 (0)