diff --git a/.circleci/config.yml b/.circleci/config.yml index 5db7f672..d37ba249 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: test: working_directory: /tmp/cci-test docker: - - image: circleci/python:3.9.7 + - image: cimg/python:3.9.13 - image: circleci/redis:3.2-alpine steps: - checkout diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c2c35c8..525e384f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,16 @@ ## Pre-release ### Implemented enhancements -* GLS-316 - Add functionality to store a hero CTA title and URL for the investment atlas landing page. +* GLS-403 - Upgrade to Python version 3.9.13 +* GLS-407 - Remove International EU exit form ### Fixed bugs +## [2.4.0](https://github.com/uktrade/directory-cms/releases/tag/2.4.0) +[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.3.3...2.4.0) +### Implemented enhancements +* GLS-316 - Add functionality to store a hero CTA title and URL for the investment atlas landing page. + ## [2.3.3](https://github.com/uktrade/directory-cms/releases/tag/2.3.3) [Full Changelog](https://github.com/uktrade/directory-cms/compare/2.3.2...2.3.3) diff --git a/core/forms.py b/core/forms.py index d3fc0c88..1df2dbcc 100644 --- a/core/forms.py +++ b/core/forms.py @@ -93,7 +93,7 @@ def set_required_for_language(form_class): class WagtailAdminPageExclusivePageForm(WagtailAdminPageForm): def __init__(self, *args, **kwargs): - if( + if ( hasattr(self._meta.model, 'slug_identity') and 'initial' not in kwargs ): kwargs['initial'] = { diff --git a/core/serializer_mapping.py b/core/serializer_mapping.py index c8f1e306..99fd493d 100644 --- a/core/serializer_mapping.py +++ b/core/serializer_mapping.py @@ -32,8 +32,6 @@ # Still used but old styles for content # ------------------------------------- - great_international.models.great_international.InternationalEUExitFormPage: great_international.serializers.InternationalEUExitFormPageSerializer, # NOQA - great_international.models.great_international.InternationalEUExitFormSuccessPage: great_international.serializers.InternationalEUExitFormSuccessPageSerializer, # NOQA # 2 pages redirected, 1 with old style: great_international.models.great_international.AboutDitServicesPage: great_international.serializers.AboutDitServicesPageSerializer, # NOQA diff --git a/great_international/migrations/0156_remove_international_eu_exit_form.py b/great_international/migrations/0156_remove_international_eu_exit_form.py new file mode 100644 index 00000000..86c2a253 --- /dev/null +++ b/great_international/migrations/0156_remove_international_eu_exit_form.py @@ -0,0 +1,25 @@ +# Generated by Django 2.2.28 on 2022-09-12 16:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0059_apply_collection_ordering'), + ('wagtailforms', '0004_add_verbose_name_plural'), + ('great_international', '0155_auto_20220719_1025'), + ] + + operations = [ + migrations.RemoveField( + model_name='internationaleuexitformsuccesspage', + name='page_ptr', + ), + migrations.DeleteModel( + name='InternationalEUExitFormPage', + ), + migrations.DeleteModel( + name='InternationalEUExitFormSuccessPage', + ), + ] diff --git a/great_international/models/great_international.py b/great_international/models/great_international.py index 3b3fb5c1..75a56de8 100644 --- a/great_international/models/great_international.py +++ b/great_international/models/great_international.py @@ -9,7 +9,7 @@ from core.fields import single_struct_block_stream_field_factory from core.mixins import ServiceHomepageMixin from core.model_fields import MarkdownField -from core.models import FormPageMetaClass, WagtailAdminExclusivePageMixin +from core.models import WagtailAdminExclusivePageMixin from export_readiness import snippets from great_international.blocks import great_international as blocks from great_international.panels import great_international as panels @@ -185,8 +185,6 @@ def allowed_subpage_models(cls): return [ InternationalArticleListingPage, InternationalTopicLandingPage, - InternationalEUExitFormPage, - InternationalEUExitFormSuccessPage, investment_atlas_models.InvestmentAtlasLandingPage, fas_models.InternationalTradeHomePage, ] @@ -477,69 +475,6 @@ class InternationalTopicLandingPage(panels.InternationalTopicLandingPagePanels, ) -class InternationalEUExitFormPage( - WagtailAdminExclusivePageMixin, - BaseInternationalPage, - metaclass=FormPageMetaClass -): - # metaclass creates _label and _help_text - form_field_names = [ - 'first_name', - 'last_name', - 'email', - 'organisation_type', - 'company_name', - 'country', - 'city', - 'comment', - ] - - full_path_override = '/eu-exit-news/contact/' - slug_identity = slugs.EUEXIT_INTERNATIONAL_FORM - - subpage_types = [ - 'great_international.InternationalEUExitFormSuccessPage'] - - breadcrumbs_label = models.CharField(max_length=50) - heading = models.CharField(max_length=255) - body_text = MarkdownField() - submit_button_text = models.CharField(max_length=50) - disclaimer = models.TextField(max_length=500) - - content_panels_before_form = \ - panels.InternationalEUExitFormPagePanels.content_panels_before_form - content_panels_after_form = \ - panels.InternationalEUExitFormPagePanels.content_panels_after_form - settings_panels = panels.InternationalEUExitFormPagePanels.settings_panels - - -class InternationalEUExitFormSuccessPage( - panels.InternationalEUExitFormSuccessPagePanels, WagtailAdminExclusivePageMixin, BaseInternationalPage, -): - full_path_override = '/eu-exit-news/contact/success/' - slug_identity = slugs.EUEXIT_FORM_SUCCESS - - parent_page_types = ['great_international.InternationalEUExitFormPage'] - - breadcrumbs_label = models.CharField(max_length=50) - heading = models.CharField( - max_length=255, - verbose_name='Title' - ) - body_text = models.CharField( - max_length=255, - verbose_name='Body text', - ) - next_title = models.CharField( - max_length=255, - verbose_name='Title' - ) - next_body_text = models.CharField( - max_length=255, - verbose_name='Body text', - ) - - class AboutDitServiceField(panels.AboutDitServiceFieldPanels, models.Model): icon = models.ForeignKey( 'wagtailimages.Image', diff --git a/great_international/panels/great_international.py b/great_international/panels/great_international.py index ef95ee9a..f28c0ce0 100644 --- a/great_international/panels/great_international.py +++ b/great_international/panels/great_international.py @@ -508,57 +508,6 @@ class InternationalTopicLandingPagePanels: ) -class InternationalEUExitFormPagePanels: - - content_panels_before_form = [ - MultiFieldPanel( - heading='Hero', - children=[ - FieldPanel('breadcrumbs_label'), - FieldPanel('heading'), - FieldPanel('body_text'), - ] - ), - ] - content_panels_after_form = [ - FieldPanel('disclaimer', widget=Textarea), - FieldPanel('submit_button_text'), - SearchEngineOptimisationPanel(), - ] - - settings_panels = [ - FieldPanel('title_en_gb'), - FieldPanel('slug'), - ] - - -class InternationalEUExitFormSuccessPagePanels: - - content_panels = [ - FieldPanel('breadcrumbs_label'), - MultiFieldPanel( - heading='heading', - children=[ - FieldPanel('heading'), - FieldPanel('body_text'), - ] - ), - MultiFieldPanel( - heading='Next steps', - children=[ - FieldPanel('next_title'), - FieldPanel('next_body_text'), - ] - ), - SearchEngineOptimisationPanel(), - ] - - settings_panels = [ - FieldPanel('title_en_gb'), - FieldPanel('slug'), - ] - - class AboutDitServiceFieldPanels: panels = [ diff --git a/great_international/serializers.py b/great_international/serializers.py index d5073797..36acdff6 100644 --- a/great_international/serializers.py +++ b/great_international/serializers.py @@ -13,7 +13,6 @@ InternationalArticleListingPage, InternationalArticlePage, InternationalCampaignPage, - InternationalEUExitFormPage, InternationalInvestmentSectorPage, InternationalInvestmentSubSectorPage, WhyInvestInTheUKPage, @@ -446,30 +445,6 @@ def get_child_pages(self, obj): return articles + campaigns + sectors -class EUExitGenericFormPageSerializer(BasePageSerializer): - breadcrumbs_label = serializers.CharField() - heading = serializers.CharField() - body_text = core_fields.MarkdownToHTMLField() - submit_button_text = serializers.CharField() - disclaimer = core_fields.MarkdownToHTMLField() - - -class InternationalEUExitFormPageSerializer( - EUExitGenericFormPageSerializer, - metaclass=FormPageSerializerMetaclass -): - class Meta: - model_class = InternationalEUExitFormPage - - -class InternationalEUExitFormSuccessPageSerializer(BasePageSerializer): - breadcrumbs_label = serializers.CharField() - heading = serializers.CharField() - body_text = serializers.CharField() - next_title = serializers.CharField() - next_body_text = serializers.CharField() - - class MinimalPageSerializer(BasePageSerializer): heading = serializers.CharField(max_length=255) diff --git a/great_international/translation.py b/great_international/translation.py index c2d938dd..7ccc8c41 100644 --- a/great_international/translation.py +++ b/great_international/translation.py @@ -87,18 +87,6 @@ class InternationalTopicLandingPageTranslationOptions(BaseTranslationOptions): ) -@register(great_international.InternationalEUExitFormPage) -class InternationalEUExitFormPageTranslationOptions(BaseTranslationOptions): - fields = [] - - -@register(great_international.InternationalEUExitFormSuccessPage) -class InternationalEUExitFormSuccessPageTranslationOptions( - BaseTranslationOptions -): - fields = [] - - @register(investment_atlas.ForeignDirectInvestmentFormPage) class ForeignDirectInvestmentFormPageTranslationOptions( BaseTranslationOptions diff --git a/manifest.yml b/manifest.yml index 6c9f5f6a..6872558a 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,4 +1,4 @@ --- applications: - buildpacks: - - https://github.com/cloudfoundry/python-buildpack.git#v1.7.46 + - https://github.com/cloudfoundry/python-buildpack.git#v1.7.58 diff --git a/runtime.txt b/runtime.txt index 2153d1e1..c6f7782f 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.9.7 +python-3.9.13 diff --git a/tests/great_international/test_models.py b/tests/great_international/test_models.py index 51bf9d83..174d61e3 100644 --- a/tests/great_international/test_models.py +++ b/tests/great_international/test_models.py @@ -16,8 +16,6 @@ def test_models_hierarchy(): assert great_international.InternationalHomePage.allowed_subpage_models() == [ great_international.InternationalArticleListingPage, great_international.InternationalTopicLandingPage, - great_international.InternationalEUExitFormPage, - great_international.InternationalEUExitFormSuccessPage, investment_atlas.InvestmentAtlasLandingPage, find_a_supplier.InternationalTradeHomePage, ] @@ -37,13 +35,6 @@ def test_models_hierarchy(): assert great_international.InternationalCampaignPage.allowed_subpage_models() == [ great_international.InternationalArticlePage, ] - # EU Exit forms - assert great_international.InternationalEUExitFormPage.allowed_subpage_models() == [ - great_international.InternationalEUExitFormSuccessPage, - ] - assert great_international.InternationalEUExitFormSuccessPage.allowed_parent_page_models() == [ - great_international.InternationalEUExitFormPage, - ] assert capital_invest.CapitalInvestContactFormPage.allowed_subpage_models() == [ capital_invest.CapitalInvestContactFormSuccessPage ]