Skip to content

Commit

Permalink
Update gcn_email/core.py
Browse files Browse the repository at this point in the history
Co-authored-by: Leo Singer <[email protected]>
  • Loading branch information
dakota002 and lpsinger authored Jan 31, 2024
1 parent dc35d40 commit 1aac7ab
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions gcn_email/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@

def replace_long_values(data, max_length):
if isinstance(data, dict):
for key, value in data.items():
if isinstance(value, (str, bytes)) and len(value) > max_length:
data[key] = REPLACEMENT_TEXT
else:
replace_long_values(value, max_length)
iter = data.items()
elif isinstance(data, list):
for index, item in enumerate(data):
if isinstance(item, (str, bytes)) and len(item) > max_length:
data[index] = REPLACEMENT_TEXT
else:
replace_long_values(item, max_length)
iter = enumerate(data)
else:
return
for key, value in iter:
if isinstance(value, str) and len(value) > max_length:
data[key] = REPLACEMENT_TEXT
else:
replace_long_values(value, max_length)


def get_email_notification_subscription_table():
Expand Down

0 comments on commit 1aac7ab

Please sign in to comment.