Skip to content

Commit 4354faa

Browse files
committed
Confirm recipient’s email address by default
This matches how the API behaves – email confirmation is on unless the calling service sets the argument to `False`: https://github.com/alphagov/notifications-api/blob/0315a5be585472700c509f65224898d183e2e048/app/v2/notifications/post_notifications.py#L271 It also follows what we say in the docs, that turning off this feature is ‘not recommended’: https://github.com/alphagov/notifications-tech-docs/blob/712ed70fe68ebe77741c5983558c58bfeb25a0c2/source/rest-api.html.md.erb#L472
1 parent 336e535 commit 4354faa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/notify_client/template_email_file_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def create_file(
1818
filename,
1919
created_by_id,
2020
retention_period=90,
21-
validate_users_email=None,
21+
validate_users_email=True,
2222
):
2323
data = {
2424
"id": str(file_id),

tests/app/main/views/test_template_email_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def test_upload_file_does_not_update_template_when_placeholder_already_exists(
358358
"filename": "tests/test_pdf_files/one_page_pdf.pdf",
359359
"created_by_id": AnyStringMatching(UUID4_REGEX_PATTERN),
360360
"retention_period": 90,
361-
"validate_users_email": False,
361+
"validate_users_email": True,
362362
},
363363
),
364364
]

tests/app/notify_client/test_template_email_files_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ def test_create_file_calls_endpoint_with_correct_data(mocker, data):
3232
client.create_file(**data, service_id=service_id, template_id=template_id)
3333
data["id"] = data.pop("file_id")
3434
if "validate_users_email" not in data.keys():
35-
data["validate_users_email"] = False
35+
data["validate_users_email"] = True
3636
mock_post.assert_called_once_with(expected_url, data=data)

0 commit comments

Comments
 (0)