Skip to content

Commit 4e204b1

Browse files
authored
Exclude content length errors from recipient_error prop (#290)
* Exclude content length errors from recipient_error prop * Formatting
1 parent 525721f commit 4e204b1

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
docopt==0.6.2
22
Flask==2.3.3
33
markupsafe==2.1.4
4-
git+https://github.com/cds-snc/notifier-utils.git@52.1.9#egg=notifications-utils
4+
git+https://github.com/cds-snc/notifier-utils.git@52.1.10#egg=notifications-utils

notifications_utils/columns.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def __init__(
5959
else ["phone number", "numéro de téléphone", "to"]
6060
)
6161

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

145148
@property
146149
def recipient_error(self):
150+
# TODO: This is a bandaid solution. We need to establish why we are calling this Cell property on
151+
# Cells that do not represent a recipient value.
152+
if self.error is not None and "Some messages may be too long due to custom content." in self.error:
153+
return False
154+
147155
return self.error not in {None, self.missing_field_error}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include = '(notifications_utils|tests)/.*\.pyi?$'
55

66
[tool.poetry]
77
name = "notifications-utils"
8-
version = "52.1.9"
8+
version = "52.1.10"
99
description = "Shared python code for Notification - Provides logging utils etc."
1010
authors = ["Canadian Digital Service"]
1111
license = "MIT license"

0 commit comments

Comments
 (0)