-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #784 from uktrade/develop
Staging release
- 2020.12.07
- 2020.08.26
- 2020.06.23
- 2020.06.15
- 2020.06.12
- 2020.05.28
- 2020.05.18
- 2020.04.22
- 2020.03.23
- 2020.03.06
- 2020.03.04
- 2020.02.26
- 2020.02.07
- 4.5.14
- 4.5.13
- 4.5.12
- 4.5.11
- 4.5.10
- 4.5.9
- 4.5.8
- 4.5.7
- 4.5.6
- 4.5.5
- 4.5.4
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.9.5
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.5
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.0.0
Showing
13 changed files
with
188 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Generated by Django 2.2.6 on 2020-02-03 13:33 | ||
|
||
import logging | ||
|
||
|
||
import core.model_fields | ||
from django.db import migrations, models | ||
|
||
import pycountry | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def set_duties_and_custom_procedures_cta_link(apps, schema_editor): | ||
url = 'https://www.check-duties-customs-exporting-goods.service.gov.uk/searchproduct?d=' | ||
CountryGuidePage = apps.get_model('export_readiness', 'CountryGuidePage') | ||
for guide in CountryGuidePage.objects.all(): | ||
try: | ||
matches = pycountry.countries.search_fuzzy(guide.country.name) | ||
except LookupError: | ||
logger.warn(f'no country match for {guide.country.name}') | ||
except AttributeError: | ||
logger.warn(f'skipping {guide.title}') | ||
else: | ||
guide.duties_and_custom_procedures_cta_link = f'{url}{matches[0].alpha_2}' | ||
guide.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('export_readiness', '0072_auto_20191212_1403'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='countryguidepage', | ||
name='help_market_guide_cta_link', | ||
), | ||
migrations.AddField( | ||
model_name='countryguidepage', | ||
name='duties_and_custom_procedures_cta_link', | ||
field=models.URLField(blank=True, null=True, verbose_name='Check duties and customs procedures for exporting goods'), | ||
), | ||
migrations.AlterField( | ||
model_name='homepage', | ||
name='madb_content', | ||
field=core.model_fields.MarkdownField(blank=True, null=True, verbose_name='Content'), | ||
), | ||
migrations.RunPython(set_duties_and_custom_procedures_cta_link, reverse_code=migrations.RunPython.noop) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters