Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude content length errors from recipient_error prop #290

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/waffles/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docopt==0.6.2
Flask==2.3.3
markupsafe==2.1.4
git+https://github.com/cds-snc/notifier-utils.git@52.1.9#egg=notifications-utils
git+https://github.com/cds-snc/notifier-utils.git@52.1.10#egg=notifications-utils
8 changes: 8 additions & 0 deletions notifications_utils/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def __init__(
else ["phone number", "numéro de téléphone", "to"]
)

# This won't mark a row as too long in all cases. A message can be too long if
# placeholder content is added by a user that exceeds the limit when added to
# the template's content.
if template:
template.values = row_dict
self.message_too_long = template.is_message_too_long()
Expand Down Expand Up @@ -144,4 +147,9 @@ def __eq__(self, other):

@property
def recipient_error(self):
# TODO: This is a bandaid solution. We need to establish why we are calling this Cell property on
# Cells that do not represent a recipient value.
if self.error is not None and "Some messages may be too long due to custom content." in self.error:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this case not considered an error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there some tests that cover what should and should not be considered an error?

return False

return self.error not in {None, self.missing_field_error}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include = '(notifications_utils|tests)/.*\.pyi?$'

[tool.poetry]
name = "notifications-utils"
version = "52.1.9"
version = "52.1.10"
description = "Shared python code for Notification - Provides logging utils etc."
authors = ["Canadian Digital Service"]
license = "MIT license"
Expand Down
Loading