Fixin' bugs.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-02-08 13:14:19 -05:00
parent f43ad68329
commit b5c2a8e240
3 changed files with 10 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
from strenum import StrEnum # In 3.11 this is in the enum library. We will not need
# this external library any more.
from strenum import StrEnum # type: ignore [import-not-found]
# In 3.11 this is in the enum library. We will not need this external library any more.
# The line will simply change from importing from strenum to importing from enum.
# And the strenum library can then be removed from poetry.
class TemplateType(StrEnum):

View File

@@ -1164,8 +1164,10 @@ class TemplateBase(db.Model):
def _as_utils_template(self):
if self.template_type == TemplateType.EMAIL:
return PlainTextEmailTemplate(self.__dict__)
if self.template_type == TemplateType.SMS:
elif self.template_type == TemplateType.SMS:
return SMSMessageTemplate(self.__dict__)
else:
raise ValueError(f"{self.template_type} is an invalid template type.")
def _as_utils_template_with_personalisation(self, values):
template = self._as_utils_template()