From 558e68523cf4753b39e14cfaa79b9b577778284a Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Thu, 9 Jan 2025 12:19:07 +0000 Subject: [PATCH 01/20] Fix download link for 5_Reasons_To_Buy_From_the_UK_RElQ4Ie.pdf --- .../templates/buy_from_the_uk/index.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index 82c965077d..5d8f5cb5b9 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -57,9 +57,7 @@

Download our ebook: 5 reasons to buy from the UK

- Download - + href="/documents/817/5_Reasons_To_Buy_From_the_UK_RElQ4Ie.pdf">Download From 390d22d470684acfcea858c36e4b5427092487a0 Mon Sep 17 00:00:00 2001 From: Sebastian Lees Date: Thu, 9 Jan 2025 14:13:07 +0000 Subject: [PATCH 02/20] fix: remove incorrect verification for letters --- find_a_buyer/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/find_a_buyer/views.py b/find_a_buyer/views.py index ecaba4a40c..fd3ccbb798 100644 --- a/find_a_buyer/views.py +++ b/find_a_buyer/views.py @@ -51,7 +51,6 @@ def send_update_error_to_sentry(sso_user, api_response): def done(self, *args, **kwargs): data = self.serialize_form_data() - data['is_verification_letter_sent'] = True # Mixin only used in SendVerificationLetterView response = api_client.company.profile_update(sso_session_id=self.request.user.session_id, data=data) try: response.raise_for_status() From 38a706d36783bbdbdbfb90b5682a23e772e1d235 Mon Sep 17 00:00:00 2001 From: stuart-mindt <75611506+stuart-mindt@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:17:57 +0000 Subject: [PATCH 03/20] Bug IGUK-797 Fixing broken link on EYB guide and adding redirect for legacy international page to EYB (#3772) * Bug IGUK-797 Fixing broken link on EYB guide and adding redirect for legacy international page to EYB --- international/url_redirects.py | 4 ++++ international_online_offer/helpers.py | 2 +- tests/unit/international/test_redirects.py | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/international/url_redirects.py b/international/url_redirects.py index 0f07b3cf66..4f1a686e27 100644 --- a/international/url_redirects.py +++ b/international/url_redirects.py @@ -445,4 +445,8 @@ r'^international/content/investment/how-we-can-help/open-a-uk-business-bank-account/$', PermanentQuerystringRedirectView.as_view(url='/international/expand-your-business-in-the-uk/'), ), + re_path( + r'^international/content/invest/how-to-setup-in-the-uk/.*$', + PermanentQuerystringRedirectView.as_view(url='/international/expand-your-business-in-the-uk/'), + ), ] diff --git a/international_online_offer/helpers.py b/international_online_offer/helpers.py index 89b0c185f5..87fb1f726c 100644 --- a/international_online_offer/helpers.py +++ b/international_online_offer/helpers.py @@ -77,7 +77,7 @@ def get_step_guide_accordion_items(): f'

' f'

' f'' + f'detailed-guides/how-to-choose-and-set-up-a-uk-bank-account/">' f'Read our guide on business banking' f'' f'

' diff --git a/tests/unit/international/test_redirects.py b/tests/unit/international/test_redirects.py index 42187b9bf9..ebaa120ad8 100644 --- a/tests/unit/international/test_redirects.py +++ b/tests/unit/international/test_redirects.py @@ -341,6 +341,11 @@ '/international/content/investment/how-we-can-help/open-a-uk-business-bank-account/', '/international/expand-your-business-in-the-uk/', ), + ('/international/content/invest/how-to-setup-in-the-uk/', '/international/expand-your-business-in-the-uk/'), + ( + '/international/content/invest/how-to-setup-in-the-uk/random-sub-route/', + '/international/expand-your-business-in-the-uk/', + ), ), ) @pytest.mark.django_db From 72bd0477d6b9c05e25fe78be3d1f1c9aa3005901 Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Thu, 9 Jan 2025 14:24:56 +0000 Subject: [PATCH 04/20] add template tag for Guide document --- .../templates/buy_from_the_uk/index.html | 6 +- .../templatetags/__init__.py | 0 .../templatetags/document_tags.py | 15 ++ requirements.txt | 18 +- requirements_test.txt | 189 +++++++++--------- 5 files changed, 124 insertions(+), 104 deletions(-) create mode 100644 international_buy_from_the_uk/templatetags/__init__.py create mode 100644 international_buy_from_the_uk/templatetags/document_tags.py diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index 5d8f5cb5b9..ca5920ef70 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -1,5 +1,6 @@ {% extends './base.html' %} {% load static %} +{% load get_document_link from document_tags %} {% block head_title %}Buy from the UK {{ block.super }}{% endblock %} {% block meta_title %}Buy from the UK {{ block.super }}{% endblock %} {% block head_css %} @@ -56,8 +57,11 @@

Download our ebook: 5 reasons to buy from the UK

Our ebook, 5 Reasons to buy from the UK, gives insight into how the unique combination of innovation, creativity, infrastructure, robust regulatory framework, and access to capital makes the UK one of the top markets to find a supplier.

+ {% get_document_link "5_Reasons_To_Buy_From_the_UK_RElQ4Ie'" as document_link %} Download + href="{{ document_link }}""> + Download + diff --git a/international_buy_from_the_uk/templatetags/__init__.py b/international_buy_from_the_uk/templatetags/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/international_buy_from_the_uk/templatetags/document_tags.py b/international_buy_from_the_uk/templatetags/document_tags.py new file mode 100644 index 0000000000..471b31cab8 --- /dev/null +++ b/international_buy_from_the_uk/templatetags/document_tags.py @@ -0,0 +1,15 @@ +from django import template +from django.conf import settings +from wagtail.documents.models import Document + +register = template.Library() + + +@register.simple_tag +def get_document_link(document_title: str) -> str: + try: + document = Document.objects.get(title=document_title) + except Document.DoesNotExist: + return '' + else: + return f'{settings.BASE_URL}/documents/{document.id}/{document_title}.pdf' diff --git a/requirements.txt b/requirements.txt index aafeb170b4..06551fd56c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -71,9 +71,9 @@ cfgv==3.4.0 # via pre-commit chardet==5.2.0 # via reportlab -charset-normalizer==3.4.0 +charset-normalizer==3.4.1 # via requests -click==8.1.7 +click==8.1.8 # via # celery # click-didyoumean @@ -239,7 +239,7 @@ factory-boy==3.3.0 # via # -r requirements.in # wagtail-factories -faker==33.1.0 +faker==33.3.0 # via factory-boy filelock==3.16.1 # via virtualenv @@ -253,7 +253,7 @@ googleapis-common-protos==1.66.0 # opentelemetry-exporter-otlp-proto-http great-components==2.7.2 # via -r requirements.in -grpcio==1.68.1 +grpcio==1.69.0 # via opentelemetry-exporter-otlp-proto-grpc gunicorn==22.0.0 # via -r requirements.in @@ -265,7 +265,7 @@ html5lib==1.1 # xhtml2pdf icalendar==5.0.11 # via -r requirements.in -identify==2.6.3 +identify==2.6.5 # via pre-commit idna==3.10 # via requests @@ -279,7 +279,7 @@ inflection==0.5.1 # via drf-spectacular iso3166==1.0.1 # via -r requirements.in -jinja2==3.1.4 +jinja2==3.1.5 # via sphinx jmespath==1.0.1 # via @@ -373,7 +373,7 @@ opentelemetry-sdk==1.22.0 # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http # opentelemetry-sdk-extension-aws -opentelemetry-sdk-extension-aws==2.0.2 +opentelemetry-sdk-extension-aws==2.1.0 # via dbt-copilot-python opentelemetry-semantic-conventions==0.43b0 # via @@ -423,7 +423,7 @@ pydantic-core==2.18.4 # via pydantic pydantic-settings==2.3.1 # via -r requirements.in -pygments==2.18.0 +pygments==2.19.1 # via sphinx pyhanko==0.25.1 # via xhtml2pdf @@ -596,7 +596,7 @@ vine==5.1.0 # amqp # celery # kombu -virtualenv==20.28.0 +virtualenv==20.28.1 # via pre-commit w3lib==1.22.0 # via directory-client-core diff --git a/requirements_test.txt b/requirements_test.txt index b6d732e080..7effd4bb27 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -23,7 +23,7 @@ asn1crypto==1.5.1 # oscrypto # pyhanko # pyhanko-certvalidator -astroid==3.3.6 +astroid==3.3.8 # via pylint asttokens==3.0.0 # via stack-data @@ -36,7 +36,7 @@ attrs==24.3.0 # trio babel==2.12.1 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # sphinx backoff==2.2.1 # via @@ -62,7 +62,7 @@ blinker==1.9.0 # via flask boto3==1.24.96 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # django-storages botocore==1.27.96 # via @@ -70,7 +70,7 @@ botocore==1.27.96 # s3transfer brotli==1.1.0 # via geventhttpclient -browserstack-local==1.2.9 +browserstack-local==1.2.10 # via browserstack-sdk browserstack-sdk==1.12.0 # via -r requirements_test.in @@ -78,12 +78,12 @@ build==1.2.2.post1 # via pip-tools celery[redis]==5.3.6 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # dbt-copilot-python # django-celery-beat certifi==2024.7.4 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # elastic-apm # elasticsearch # geventhttpclient @@ -97,9 +97,9 @@ cfgv==3.4.0 # via pre-commit chardet==5.2.0 # via reportlab -charset-normalizer==3.4.0 +charset-normalizer==3.4.1 # via requests -click==8.1.7 +click==8.1.8 # via # black # celery @@ -120,7 +120,7 @@ colorama==0.4.6 # via djlint configargparse==1.7 # via locust -coverage[toml]==7.6.9 +coverage[toml]==7.6.10 # via # pytest-codecov # pytest-cov @@ -128,7 +128,7 @@ cron-descriptor==1.4.5 # via django-celery-beat cryptography==43.0.1 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # pyhanko # pyhanko-certvalidator cssbeautifier==1.15.1 @@ -139,10 +139,10 @@ cssselect2==0.7.0 # via svglib dateparser==0.7.2 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # -r requirements_test.in dbt-copilot-python==0.2.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in decorator==5.1.1 # via # ipdb @@ -157,38 +157,38 @@ deprecated==1.2.15 dill==0.3.9 # via pylint directory-api-client==26.12.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in directory-ch-client==4.0.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in directory-client-core==7.2.13 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # directory-api-client # directory-ch-client # directory-forms-api-client # directory-sso-api-client directory-components==40.2.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in directory-constants==24.1.3 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # directory-components # great-components directory-forms-api-client==7.4.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in directory-healthcheck==3.7 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in directory-sso-api-client==7.2.7 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in directory-validators==9.3.4 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in distlib==0.3.9 # via virtualenv dj-database-url==2.2.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django==4.2.17 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # directory-api-client # directory-ch-client # directory-client-core @@ -223,40 +223,40 @@ django==4.2.17 # wagtail-localize # wagtailmedia django-celery-beat==2.5.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-csp==3.7 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-debug-toolbar==3.2.4 # via -r requirements_test.in django-decorator-include==3.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-environ==0.11.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-extensions==3.2.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-filter==23.5 # via wagtail django-formtools==2.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-health-check==3.18.2 # via directory-healthcheck django-ipware==6.0.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-log-formatter-asim==0.0.4 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-modelcluster==6.4 # via wagtail django-permissionedforms==0.1 # via wagtail django-recaptcha==3.0.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-redis==5.4.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-staff-sso-client==4.3.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in django-storages[boto3]==1.13.2 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # django-storages django-taggit==4.0.0 # via wagtail @@ -264,30 +264,30 @@ django-timezone-field==7.0 # via django-celery-beat django-treebeard==4.7 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # wagtail djangorestframework==3.15.2 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # drf-spectacular # sigauth # wagtail -djlint==1.36.3 +djlint==1.36.4 # via -r requirements_test.in docutils==0.21.2 # via sphinx draftjs-exporter==2.1.7 # via wagtail drf-spectacular==0.26.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in editorconfig==0.17.0 # via # cssbeautifier # jsbeautifier elastic-apm==6.1.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in elasticsearch==7.13.4 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in et-xmlfile==2.0.0 # via openpyxl events==0.5 @@ -304,9 +304,9 @@ executing==2.1.0 # via stack-data factory-boy==3.3.0 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # wagtail-factories -faker==33.1.0 +faker==33.3.0 # via factory-boy filelock==3.16.1 # via virtualenv @@ -343,40 +343,40 @@ flask-login==0.6.3 freezegun==1.1.0 # via -r requirements_test.in geoip2==2.9.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in gevent==24.11.1 # via # geventhttpclient # locust geventhttpclient==2.2.1 # via locust -gitdb==4.0.11 +gitdb==4.0.12 # via gitpython -gitpython==3.1.43 +gitpython==3.1.44 # via -r requirements_test.in googleapis-common-protos==1.66.0 # via # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http great-components==2.7.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in greenlet==3.1.1 # via gevent -grpcio==1.68.1 +grpcio==1.69.0 # via opentelemetry-exporter-otlp-proto-grpc gunicorn==22.0.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in h11==0.14.0 # via wsproto hashids==0.8.4 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in html5lib==1.1 # via # wagtail # xhtml2pdf icalendar==5.0.11 - # via -r requirements.in -identify==2.6.3 + # via -r /Users/davidurquhart/great/greatcms/requirements.in +identify==2.6.5 # via pre-commit idna==3.10 # via @@ -399,7 +399,7 @@ ipdb==0.13.13 ipython==8.18.1 # via ipdb iso3166==1.0.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in isort==5.12.0 # via # -r requirements_test.in @@ -408,7 +408,7 @@ itsdangerous==2.2.0 # via flask jedi==0.19.2 # via ipython -jinja2==3.1.4 +jinja2==3.1.5 # via # flask # sphinx @@ -435,12 +435,12 @@ locust==2.27.0 # via -r requirements_test.in lxml==5.1.0 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # pyquery # svglib markdown2==2.4.0 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # readtime markupsafe==3.0.2 # via @@ -468,21 +468,21 @@ nodeenv==1.9.1 # via pre-commit numpy==1.26.4 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # pandas oauthlib==3.2.2 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # requests-oauthlib olefile==0.47 # via directory-validators openpyxl==3.1.5 # via wagtail opensearch-dsl==2.1.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in opensearch-py==2.6.0 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # opensearch-dsl opentelemetry-api==1.22.0 # via @@ -524,7 +524,7 @@ opentelemetry-sdk==1.22.0 # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http # opentelemetry-sdk-extension-aws -opentelemetry-sdk-extension-aws==2.0.2 +opentelemetry-sdk-extension-aws==2.1.0 # via dbt-copilot-python opentelemetry-semantic-conventions==0.43b0 # via @@ -547,7 +547,7 @@ packaging==24.2 # sphinx # webdriver-manager pandas==1.5.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in parso==0.8.4 # via jedi pathspec==0.12.1 @@ -560,7 +560,7 @@ pexpect==4.9.0 # via ipython pillow==10.3.0 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # -r requirements_test.in # directory-validators # pillow-heif @@ -594,13 +594,13 @@ protobuf==4.25.5 # via # googleapis-common-protos # opentelemetry-proto -psutil==6.1.0 +psutil==6.1.1 # via # browserstack-local # browserstack-sdk # locust psycopg2==2.9.9 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in ptyprocess==0.7.0 # via pexpect pure-eval==0.2.3 @@ -614,15 +614,15 @@ pycparser==2.22 # via cffi pydantic==2.7.3 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # pydantic-settings pydantic-core==2.18.4 # via pydantic pydantic-settings==2.3.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in pyflakes==3.1.0 # via flake8 -pygments==2.18.0 +pygments==2.19.1 # via # ipython # sphinx @@ -632,7 +632,7 @@ pyhanko-certvalidator==0.26.5 # via # pyhanko # xhtml2pdf -pylint==3.3.2 +pylint==3.3.3 # via # pylint-django # pylint-plugin-utils @@ -674,7 +674,7 @@ pytest-xdist==3.6.1 # via -r requirements_test.in python-bidi==0.4.2 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # xhtml2pdf python-crontab==3.2.0 # via django-celery-beat @@ -697,7 +697,7 @@ python-dotenv==1.0.1 python-ipware==3.0.0 # via django-ipware python-magic==0.4.27 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in pytz==2023.3 # via # dateparser @@ -717,7 +717,7 @@ pyzmq==26.2.0 qrcode==8.0 # via pyhanko readtime==1.1.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in redis==5.2.1 # via # celery @@ -756,7 +756,7 @@ requests-oauthlib==2.0.0 # via django-staff-sso-client requests-toolbelt==1.0.0 # via browserstack-sdk -ruamel-yaml==0.18.6 +ruamel-yaml==0.18.10 # via pre-commit-hooks ruamel-yaml-clib==0.2.12 # via ruamel-yaml @@ -765,10 +765,10 @@ s3transfer==0.6.2 selenium==4.27.1 # via -r requirements_test.in sentry-sdk==2.19.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in sigauth==5.3.0 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # directory-client-core six==1.17.0 # via @@ -783,7 +783,7 @@ six==1.17.0 # python-bidi # python-dateutil # w3lib -smmap==5.0.1 +smmap==5.0.2 # via gitdb sniffio==1.3.1 # via trio @@ -794,7 +794,7 @@ sortedcontainers==2.4.0 soupsieve==2.6 # via beautifulsoup4 sphinx==7.3.7 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in sphinxcontrib-applehelp==2.0.0 # via sphinx sphinxcontrib-devhelp==2.0.0 @@ -808,7 +808,7 @@ sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 # via sphinx sqlalchemy==1.4.49 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in sqlparse==0.5.3 # via # django @@ -818,7 +818,7 @@ stack-data==0.6.3 svglib==1.5.1 # via xhtml2pdf tablib==3.5.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in telepath==0.3.1 # via wagtail termcolor==2.5.0 @@ -851,7 +851,7 @@ traitlets==5.14.3 # via # ipython # matplotlib-inline -trio==0.27.0 +trio==0.28.0 # via # selenium # trio-websocket @@ -863,6 +863,7 @@ typing-extensions==4.12.2 # astroid # black # dj-database-url + # djlint # faker # ipython # kombu @@ -883,14 +884,14 @@ tzlocal==5.2 # dateparser # pyhanko uk-postcode-utils==1.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in uritemplate==4.1.1 # via drf-spectacular uritools==4.0.3 # via pyhanko-certvalidator urllib3[socks]==1.26.19 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # botocore # directory-validators # elastic-apm @@ -905,13 +906,13 @@ vine==5.1.0 # amqp # celery # kombu -virtualenv==20.28.0 +virtualenv==20.28.1 # via pre-commit w3lib==1.22.0 # via directory-client-core wagtail==5.2.6 # via - # -r requirements.in + # -r /Users/davidurquhart/great/greatcms/requirements.in # wagtail-cache # wagtail-factories # wagtail-localize @@ -920,21 +921,21 @@ wagtail==5.2.6 # wagtail-trash # wagtailmedia wagtail-cache==2.3.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtail-factories==4.1.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtail-font-awesome-svg==0.0.3 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtail-localize==1.7 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtail-seo==2.4.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtail-transfer==0.9.2 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtail-trash==1.0.1 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wagtailmedia==0.14.5 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in wcwidth==0.2.13 # via prompt-toolkit webdriver-manager==4.0.2 @@ -955,7 +956,7 @@ werkzeug==3.1.3 wheel==0.45.1 # via pip-tools whitenoise==6.6.0 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in willow[heif]==1.6.3 # via # wagtail @@ -967,7 +968,7 @@ wrapt==1.17.0 wsproto==1.2.0 # via trio-websocket xhtml2pdf==0.2.15 - # via -r requirements.in + # via -r /Users/davidurquhart/great/greatcms/requirements.in zipp==3.21.0 # via importlib-metadata zope-event==5.0 From 3f9c16abac54f22f3d4c485b6ead032c7201a4b1 Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Thu, 9 Jan 2025 14:48:35 +0000 Subject: [PATCH 05/20] added document type --- .../templates/buy_from_the_uk/index.html | 2 +- international_buy_from_the_uk/templatetags/document_tags.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index ca5920ef70..fc094c9cb5 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -57,7 +57,7 @@

Download our ebook: 5 reasons to buy from the UK

Our ebook, 5 Reasons to buy from the UK, gives insight into how the unique combination of innovation, creativity, infrastructure, robust regulatory framework, and access to capital makes the UK one of the top markets to find a supplier.

- {% get_document_link "5_Reasons_To_Buy_From_the_UK_RElQ4Ie'" as document_link %} + {% get_document_link "5_Reasons_To_Buy_From_the_UK_RElQ4Ie" "pdf" as document_link %} Download diff --git a/international_buy_from_the_uk/templatetags/document_tags.py b/international_buy_from_the_uk/templatetags/document_tags.py index 471b31cab8..09832e1f70 100644 --- a/international_buy_from_the_uk/templatetags/document_tags.py +++ b/international_buy_from_the_uk/templatetags/document_tags.py @@ -6,10 +6,10 @@ @register.simple_tag -def get_document_link(document_title: str) -> str: +def get_document_link(document_title: str, document_type) -> str: try: document = Document.objects.get(title=document_title) except Document.DoesNotExist: return '' else: - return f'{settings.BASE_URL}/documents/{document.id}/{document_title}.pdf' + return f'{settings.BASE_URL}/documents/{document.id}/{document_title}.{document_type}' From c5579dba8101ef14f46c03e250c54d3d1d6298e5 Mon Sep 17 00:00:00 2001 From: Sebastian Lees Date: Thu, 9 Jan 2025 15:40:35 +0000 Subject: [PATCH 06/20] fix: tests --- tests/unit/find_a_buyer/test_views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/find_a_buyer/test_views.py b/tests/unit/find_a_buyer/test_views.py index 050c21e35b..98b30bd0a7 100644 --- a/tests/unit/find_a_buyer/test_views.py +++ b/tests/unit/find_a_buyer/test_views.py @@ -23,7 +23,7 @@ def all_company_profile_data(): 'address_line_1': '123 Fake Street', 'address_line_2': 'Fakeville', 'locality': 'London', - 'postal_code': 'E14 6XK', + 'postal_code': 'E14 6XK', # /PS-IGNORE 'po_box': 'abc', 'country': 'GB', 'export_destinations': ['CN', 'IN'], @@ -108,7 +108,7 @@ def test_send_verification_letter_address_context_data(client, user, mock_get_co assert response.context['company_name'] == 'Great company' assert response.context['company_number'] == 123456 - assert response.context['company_address'] == ('123 Fake Street, Fakeville, London, GB, E14 6XK') + assert response.context['company_address'] == ('123 Fake Street, Fakeville, London, GB, E14 6XK') # /PS-IGNORE @pytest.mark.django_db @@ -252,7 +252,7 @@ def test_verify_company_address_end_to_end(mock_profile_update, send_verificatio assert response.template_name == view.templates[view.SENT] assert mock_profile_update.call_count == 1 assert mock_profile_update.call_args == call( - data={'postal_full_name': 'Jeremy', 'is_verification_letter_sent': True}, + data={'postal_full_name': 'Jeremy', 'is_verification_letter_sent': False}, # /PS-IGNORE sso_session_id='123', ) From 49f539d07280363ebc93d5cbaf56fc42ab1aa3e2 Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Thu, 9 Jan 2025 15:49:05 +0000 Subject: [PATCH 07/20] revise document link template tag --- .../templates/buy_from_the_uk/index.html | 5 +---- international_buy_from_the_uk/templatetags/document_tags.py | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index fc094c9cb5..3c8db96bd2 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -58,10 +58,7 @@

Download our ebook: 5 reasons to buy from the UK

{% get_document_link "5_Reasons_To_Buy_From_the_UK_RElQ4Ie" "pdf" as document_link %} -
- Download - + Download diff --git a/international_buy_from_the_uk/templatetags/document_tags.py b/international_buy_from_the_uk/templatetags/document_tags.py index 09832e1f70..bf8f0d5744 100644 --- a/international_buy_from_the_uk/templatetags/document_tags.py +++ b/international_buy_from_the_uk/templatetags/document_tags.py @@ -1,5 +1,4 @@ from django import template -from django.conf import settings from wagtail.documents.models import Document register = template.Library() @@ -12,4 +11,4 @@ def get_document_link(document_title: str, document_type) -> str: except Document.DoesNotExist: return '' else: - return f'{settings.BASE_URL}/documents/{document.id}/{document_title}.{document_type}' + return f'/documents/{document.id}/{document_title}.{document_type}' From dc2f6e9cf19b956ee4b8ee13e2114bcf627de11a Mon Sep 17 00:00:00 2001 From: Sebastian Lees Date: Thu, 9 Jan 2025 16:02:25 +0000 Subject: [PATCH 08/20] fix: tests --- tests/unit/find_a_buyer/test_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/find_a_buyer/test_views.py b/tests/unit/find_a_buyer/test_views.py index 98b30bd0a7..5626c85cc9 100644 --- a/tests/unit/find_a_buyer/test_views.py +++ b/tests/unit/find_a_buyer/test_views.py @@ -252,7 +252,7 @@ def test_verify_company_address_end_to_end(mock_profile_update, send_verificatio assert response.template_name == view.templates[view.SENT] assert mock_profile_update.call_count == 1 assert mock_profile_update.call_args == call( - data={'postal_full_name': 'Jeremy', 'is_verification_letter_sent': False}, # /PS-IGNORE + data={'postal_full_name': 'Jeremy'}, sso_session_id='123', ) From 26e3bad416cfbf20eafc3bab6817ff4b9bbddaad Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Thu, 9 Jan 2025 16:36:52 +0000 Subject: [PATCH 09/20] revise document link template tag --- international_buy_from_the_uk/templatetags/document_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international_buy_from_the_uk/templatetags/document_tags.py b/international_buy_from_the_uk/templatetags/document_tags.py index bf8f0d5744..f4bf1dad38 100644 --- a/international_buy_from_the_uk/templatetags/document_tags.py +++ b/international_buy_from_the_uk/templatetags/document_tags.py @@ -11,4 +11,4 @@ def get_document_link(document_title: str, document_type) -> str: except Document.DoesNotExist: return '' else: - return f'/documents/{document.id}/{document_title}.{document_type}' + return document.url From 072d37fc91d7b8c36b4d0690e3af118c28d15410 Mon Sep 17 00:00:00 2001 From: bobby-didcoding Date: Fri, 10 Jan 2025 10:19:00 +0000 Subject: [PATCH 10/20] Added new view to handle form sucess in international --- exportplan/context.py | 16 +- exportplan/forms.py | 6 +- .../templates/international/contact.html | 141 +++++++++--------- .../international/contact_success.html | 30 ++++ international/urls.py | 7 +- international/views.py | 30 +++- tests/unit/international/test_views.py | 7 + 7 files changed, 150 insertions(+), 87 deletions(-) create mode 100644 international/templates/international/contact_success.html diff --git a/exportplan/context.py b/exportplan/context.py index df08a43055..7b2c1dc429 100644 --- a/exportplan/context.py +++ b/exportplan/context.py @@ -75,15 +75,15 @@ def get_context_provider_data(self, request, **kwargs): age_group_population_data[section] = {} age_groups = self.export_plan.data['ui_options'].get(section, {}).get('target_ages', []) age_group_population_data[section]['target_ages'] = age_groups - age_group_population_data[section]['male_target_age_population'] = ( - helpers.total_population_by_gender_age( - dataset=population_dataset, age_filter=age_groups, gender='male' - ) + age_group_population_data[section][ + 'male_target_age_population' + ] = helpers.total_population_by_gender_age( + dataset=population_dataset, age_filter=age_groups, gender='male' ) - age_group_population_data[section]['female_target_age_population'] = ( - helpers.total_population_by_gender_age( - dataset=population_dataset, age_filter=age_groups, gender='female' - ) + age_group_population_data[section][ + 'female_target_age_population' + ] = helpers.total_population_by_gender_age( + dataset=population_dataset, age_filter=age_groups, gender='female' ) age_group_population_data[section]['total_target_age_population'] = int( age_group_population_data[section]['male_target_age_population'] diff --git a/exportplan/forms.py b/exportplan/forms.py index 5a46313fb5..bfdc35093d 100644 --- a/exportplan/forms.py +++ b/exportplan/forms.py @@ -122,9 +122,9 @@ def set_country_specific_text(self, country_name): self.fields['demand'].label = f'Describe the consumer demand for your product in the {country_name}' self.fields['competitors'].label = f'Who are your competitors in the {country_name}?' self.fields['trend'].label = f'What are the product trends in the {country_name}?' - self.fields['unqiue_selling_proposition'].label = ( - f'What’s your unique selling proposition for the {country_name}?' - ) + self.fields[ + 'unqiue_selling_proposition' + ].label = f'What’s your unique selling proposition for the {country_name}?' self.fields['average_price'].label = f'What’s the avg price for your product in the {country_name}?' self.fields['trend'].widget.attrs['description'] = ( f'Describe what you know about the product market in the {country_name}. ' diff --git a/international/templates/international/contact.html b/international/templates/international/contact.html index 6b5576c105..2940d32099 100644 --- a/international/templates/international/contact.html +++ b/international/templates/international/contact.html @@ -23,91 +23,86 @@ {% endblock %} {% block content %}
- {% if request.GET.success %} -
-
{% include './includes/contact_success.html' with back_url=back_url %}
+ {% if form.errors and not form.non_field_errors %} + - {% else %} - {% if form.errors and not form.non_field_errors %} -
From a33f5b64c23a25d8b3729e9df9c59c99ef47150d Mon Sep 17 00:00:00 2001 From: Jamie Fox <134952460+FoxJamie16@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:14:30 +0000 Subject: [PATCH 17/20] add conditional to only initialise hcsat javascript when hcsat form is loaded to fix unhandled error (#3779) --- .../templates/business_profile/profile.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sso_profile/templates/business_profile/profile.html b/sso_profile/templates/business_profile/profile.html index 819e6c3fb6..63d64315a0 100644 --- a/sso_profile/templates/business_profile/profile.html +++ b/sso_profile/templates/business_profile/profile.html @@ -419,10 +419,12 @@

Business showc {{ block.super }} - - +{% if company.is_published %} + + +{% endif %} {% endblock %} \ No newline at end of file From 77b6a52d1159f7432c07d8af6bb1b1d544c94908 Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Fri, 10 Jan 2025 14:28:41 +0000 Subject: [PATCH 18/20] re-work --- config/urls.py | 2 +- core/views.py | 3 +-- .../templates/buy_from_the_uk/index.html | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/config/urls.py b/config/urls.py index aaee7ccfa6..b72c895e4f 100644 --- a/config/urls.py +++ b/config/urls.py @@ -84,7 +84,7 @@ ), path('admin/', decorator_include([skip_ga360, nocache_page], wagtailadmin_urls)), path( - 'document//', + 'document/get//', nocache_page(WagtailServeDocument.as_view()), name='wagtail_serve_documents', ), diff --git a/core/views.py b/core/views.py index 5b64f232b2..d9886e2246 100644 --- a/core/views.py +++ b/core/views.py @@ -1035,5 +1035,4 @@ def get(self, request, document_title): except Document.DoesNotExist: return HttpResponseBadRequest(()) else: - url = f'/documents/{document.id}/{document.filename}' - return HttpResponseRedirect(redirect_to=url) + return HttpResponseRedirect(redirect_to=document.file.url) diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index be753bb07f..8e21501507 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -57,7 +57,7 @@

Download our ebook: 5 reasons to buy from the UK

Download + href="/document/get/5_Reasons_To_Buy_From_the_UK_RElQ4Ie">Download

From e915c41ad3de58e0375acedd6c0730207dd0cfc3 Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Fri, 10 Jan 2025 14:48:13 +0000 Subject: [PATCH 19/20] wrong doc name --- .../templates/buy_from_the_uk/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index 8e21501507..01535cfdcd 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -57,7 +57,7 @@

Download our ebook: 5 reasons to buy from the UK

Download + href="/document/get/Five reasons to buy from the UK">Download From 5b64629f44727a6acc2e22c4cf66820751fcab73 Mon Sep 17 00:00:00 2001 From: davidu1975 Date: Fri, 10 Jan 2025 15:16:31 +0000 Subject: [PATCH 20/20] removed unneccesary template tag --- config/urls.py | 8 ++++---- .../templates/buy_from_the_uk/index.html | 3 +-- .../templatetags/__init__.py | 0 .../templatetags/document_tags.py | 14 -------------- 4 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 international_buy_from_the_uk/templatetags/__init__.py delete mode 100644 international_buy_from_the_uk/templatetags/document_tags.py diff --git a/config/urls.py b/config/urls.py index b72c895e4f..ac6cf68ee1 100644 --- a/config/urls.py +++ b/config/urls.py @@ -84,13 +84,13 @@ ), path('admin/', decorator_include([skip_ga360, nocache_page], wagtailadmin_urls)), path( - 'document/get//', + 'documents/', decorator_include(nocache_page, wagtaildocs_urls) + ), # NB: doesn't skip GA as we may analytics on this + path( + 'document//', nocache_page(WagtailServeDocument.as_view()), name='wagtail_serve_documents', ), - path( - 'documents/', decorator_include(nocache_page, wagtaildocs_urls) - ), # NB: doesn't skip GA as we may analytics on this path('great-cms-sso/', include(sso.urls)), path('search/', include(search.urls, namespace='search')), path('activity-stream/', decorator_include(nocache_page, activitystream.urls, namespace='activitystream')), diff --git a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html index 01535cfdcd..32e3b1ec94 100644 --- a/international_buy_from_the_uk/templates/buy_from_the_uk/index.html +++ b/international_buy_from_the_uk/templates/buy_from_the_uk/index.html @@ -56,8 +56,7 @@

Download our ebook: 5 reasons to buy from the UK

Our ebook, 5 Reasons to buy from the UK, gives insight into how the unique combination of innovation, creativity, infrastructure, robust regulatory framework, and access to capital makes the UK one of the top markets to find a supplier.

- Download + Download diff --git a/international_buy_from_the_uk/templatetags/__init__.py b/international_buy_from_the_uk/templatetags/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/international_buy_from_the_uk/templatetags/document_tags.py b/international_buy_from_the_uk/templatetags/document_tags.py deleted file mode 100644 index f7a85327f9..0000000000 --- a/international_buy_from_the_uk/templatetags/document_tags.py +++ /dev/null @@ -1,14 +0,0 @@ -from django import template -from wagtail.documents.models import Document - -register = template.Library() - - -@register.simple_tag -def get_document_link(document_title: str, document_type) -> str: - try: - document = Document.objects.get(title=document_title) - except Document.DoesNotExist: - return '' - else: - return f'/documents/{document.id}/{document_title}.{document_type}?download=True'