From 7c12c6c8f0be5c611c5463277a574489a4b9a338 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Wed, 15 Jul 2020 10:23:54 +0100 Subject: [PATCH 1/3] Fix international letter rate start dates These were not taking timezones into account before. --- .../versions/0325_int_letter_rates_fix.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 migrations/versions/0325_int_letter_rates_fix.py diff --git a/migrations/versions/0325_int_letter_rates_fix.py b/migrations/versions/0325_int_letter_rates_fix.py new file mode 100644 index 000000000..16f0b47fb --- /dev/null +++ b/migrations/versions/0325_int_letter_rates_fix.py @@ -0,0 +1,32 @@ +""" + +Revision ID: 0325_int_letter_rates_fix +Revises: 0324_int_letter_rates +Create Date: 2020-07-15 10:09:17.218183 + +""" +from datetime import datetime + +from alembic import op +from sqlalchemy.sql import text + +revision = '0325_int_letter_rates_fix' +down_revision = '0324_int_letter_rates' + + +old_start_date = datetime(2020, 7, 1, 0, 0) +new_start_date = datetime(2020, 6, 30, 23, 0) + + +def upgrade(): + conn = op.get_bind() + conn.execute(text( + """UPDATE letter_rates SET start_date = :new_start_date WHERE start_date = :old_start_date""" + ), new_start_date=new_start_date, old_start_date=old_start_date) + + +def downgrade(): + conn = op.get_bind() + conn.execute(text( + """UPDATE letter_rates SET start_date = :old_start_date WHERE start_date = :new_start_date""" + ), old_start_date=old_start_date, new_start_date=new_start_date) From 8bba04e1cebd150896d00597b93d45201fcba63e Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 15 Jul 2020 13:17:11 +0100 Subject: [PATCH 2/3] Update the MMG/Firetext ratio to 70/30 as requested. --- app/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config.py b/app/config.py index 81bab624e..3cd39ebf9 100644 --- a/app/config.py +++ b/app/config.py @@ -144,8 +144,8 @@ class Config(object): # these should always add up to 100% SMS_PROVIDER_RESTING_POINTS = { - 'mmg': 50, - 'firetext': 50 + 'mmg': 70, + 'firetext': 30 } NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553' From fd389d5c76e830cadb93a831da2e279b99fc6139 Mon Sep 17 00:00:00 2001 From: Toby Lorne Date: Tue, 21 Jul 2020 13:39:10 +0100 Subject: [PATCH 3/3] cbc: use one stub cbc per environment so we can break preview without breaking staging or production related https://github.com/alphagov/notifications-cbc-proxy/pull/7 Signed-off-by: Toby Lorne --- app/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config.py b/app/config.py index 3cd39ebf9..f3cb2e040 100644 --- a/app/config.py +++ b/app/config.py @@ -459,7 +459,7 @@ class Preview(Config): INVALID_PDF_BUCKET_NAME = 'preview-letters-invalid-pdf' TRANSIENT_UPLOADED_LETTERS = 'preview-transient-uploaded-letters' LETTER_SANITISE_BUCKET_NAME = 'preview-letters-sanitise' - CBC_PROXY_URL = 'https://notify-stub-cbc-sandbox.cloudapps.digital' + CBC_PROXY_URL = 'https://notify-stub-cbc-preview.cloudapps.digital' FROM_NUMBER = 'preview' API_RATE_LIMIT_ENABLED = True CHECK_PROXY_HEADER = False @@ -477,7 +477,7 @@ class Staging(Config): INVALID_PDF_BUCKET_NAME = 'staging-letters-invalid-pdf' TRANSIENT_UPLOADED_LETTERS = 'staging-transient-uploaded-letters' LETTER_SANITISE_BUCKET_NAME = 'staging-letters-sanitise' - CBC_PROXY_URL = 'https://notify-stub-cbc-sandbox.cloudapps.digital' + CBC_PROXY_URL = 'https://notify-stub-cbc-staging.cloudapps.digital' FROM_NUMBER = 'stage' API_RATE_LIMIT_ENABLED = True CHECK_PROXY_HEADER = True @@ -496,7 +496,7 @@ class Live(Config): INVALID_PDF_BUCKET_NAME = 'production-letters-invalid-pdf' TRANSIENT_UPLOADED_LETTERS = 'production-transient-uploaded-letters' LETTER_SANITISE_BUCKET_NAME = 'production-letters-sanitise' - CBC_PROXY_URL = 'https://notify-stub-cbc-sandbox.cloudapps.digital' + CBC_PROXY_URL = 'https://notify-stub-cbc-production.cloudapps.digital' FROM_NUMBER = 'GOVUK' PERFORMANCE_PLATFORM_ENABLED = True API_RATE_LIMIT_ENABLED = True