Skip to content

Commit

Permalink
🐛 Fix bug in migration
Browse files Browse the repository at this point in the history
django-modeltranslation fields can be None, which breaks the re.sub
usage which expects a string.
  • Loading branch information
sergei-maertens committed Dec 10, 2024
1 parent 1ba739e commit f387e17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/openforms/emails/migrations/0003_update_summary_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
SUMMARY_REGEX = r"{%\s*summary\s*%}"


def replace_tag(tpl: str) -> str:
def replace_tag(tpl: str | None) -> str | None:
if tpl is None:
return None
return re.sub(
SUMMARY_REGEX,
"{% confirmation_summary %}",
Expand Down

0 comments on commit f387e17

Please sign in to comment.