Copy templates also copies files#5871
Open
rparke wants to merge 1 commit into
Open
Conversation
af48f92 to
c12c280
Compare
rparke
commented
Apr 16, 2026
Comment on lines
+2738
to
+2749
| def test_post_copy_template_with_file( | ||
| client_request, | ||
| active_user_with_permissions, | ||
| mock_get_service, | ||
| multiple_sms_senders, | ||
| mock_get_service_email_template_with_file, | ||
| mock_get_service_templates, | ||
| mock_get_organisations_and_services_for_user, | ||
| fake_uuid, | ||
| mock_create_service_template, | ||
| mocker, | ||
| ): |
Contributor
Author
There was a problem hiding this comment.
There's a bunch of code duplication in this with test_post_copy_template_into_folder which I don't love. And mocking out uuids in a nice way proved tricky, so I'm open to any ideas to make this a bit nicer
Member
There was a problem hiding this comment.
Example of getting deterministic UUIDs without mocking:
Contributor
Author
There was a problem hiding this comment.
I still need to patch the file_id and the template_id specifically.
klssmith
reviewed
Apr 17, 2026
e4f57db to
e7ebfa6
Compare
e7ebfa6 to
c4f54ba
Compare
kr8n3r
reviewed
May 11, 2026
we noticed a bug where we werent' copying over files when copying over a template with files. This results in the new template having fileplaceholders interpreted as "regular" placeholders for normal personalisation. This downloads the old file from s3, creates a new entry in `template_email_files` and then makes it live. We don't have the api endpoints to make a file live straightaway - we may wish to implement this instead of hitting the create endpoint and then the update endpoint.
e7ba33b to
9cdc8b6
Compare
joybytes
approved these changes
May 13, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
we noticed a bug where we werent' copying over files when copying over a template with files. This results in the new template having fileplaceholders interpreted as "regular" placeholders for normal personalisation. This downloads the old file from s3, creates a new entry in
template_email_filesand then makes it live.We don't have the api endpoints to make a file live straightaway - we may wish to implement this instead of hitting the create endpoint and then the update endpoint.
Copying templates when contact link is not set:
