mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number. This is because when we built the user registration stuff we couldn’t send to international mobiles. However we can send to international mobile numbers, and it’s totally reasonable to expect employees of the UK government to be working abroad, and have a foreign mobile phone – we’ve heard from one such user. In order for users of Notify to register with an international phone number, the Notify service needs to have the `international_sms` permission set. Which this service does, as a data migration.
This commit is contained in:
33
migrations/versions/0117_international_sms_notify.py
Normal file
33
migrations/versions/0117_international_sms_notify.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0117_international_sms_notify
|
||||
Revises: 0116_another_letter_org
|
||||
Create Date: 2017-08-29 14:09:41.042061
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0117_international_sms_notify'
|
||||
down_revision = '0116_another_letter_org'
|
||||
|
||||
from alembic import op
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("""
|
||||
INSERT INTO service_permissions VALUES
|
||||
('{}', 'international_sms', '{}')
|
||||
""".format(NOTIFY_SERVICE_ID, datetime.utcnow()))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute("""
|
||||
DELETE FROM service_permissions
|
||||
WHERE
|
||||
service_id = '{}' AND
|
||||
permission = 'international_sms'
|
||||
""".format(NOTIFY_SERVICE_ID))
|
||||
Reference in New Issue
Block a user