From a171d8bb6f68720f13c6231a00d27b3dbab23c4a Mon Sep 17 00:00:00 2001 From: Miriam Forner Date: Tue, 30 Aug 2022 12:15:21 +0100 Subject: [PATCH 1/3] Upgrade to python3.9.13 --- .circleci/config.yml | 2 +- CHANGELOG.md | 1 + manifest.yml | 2 +- runtime.txt | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) 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..1b3ce29d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### 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 ### Fixed bugs 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 From 50effe00fa80b461b5f98035ebfa3437ceb5884d Mon Sep 17 00:00:00 2001 From: Miriam Forner Date: Tue, 30 Aug 2022 12:23:11 +0100 Subject: [PATCH 2/3] Fix missing whitespace --- core/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'] = { From a026cc45523280afdb28d5d8c3f1d3937c6d5cdf Mon Sep 17 00:00:00 2001 From: Miriam Forner Date: Tue, 13 Sep 2022 09:47:10 +0100 Subject: [PATCH 3/3] Remove international EU exit form --- CHANGELOG.md | 7 +- core/serializer_mapping.py | 2 - .../0156_remove_international_eu_exit_form.py | 25 +++++++ .../models/great_international.py | 67 +------------------ .../panels/great_international.py | 51 -------------- great_international/serializers.py | 25 ------- great_international/translation.py | 12 ---- tests/great_international/test_models.py | 9 --- 8 files changed, 32 insertions(+), 166 deletions(-) create mode 100644 great_international/migrations/0156_remove_international_eu_exit_form.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3ce29d..525e384f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +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/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/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 ]