Skip to content

Commit f2151c7

Browse files
committed
toms comments
1 parent 86ddd56 commit f2151c7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/spam/email_checker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ async def check_spam(self, m: EmailSendModel):
2626

2727
# prepare email info for spam check for the first recipient email only
2828
recipient = m.recipients[0]
29-
context = dict(m.context, **(recipient.context if hasattr(recipient, "context") else {}))
30-
headers = dict(m.headers, **(recipient.headers if hasattr(recipient, "headers") else {}))
29+
context = dict(m.context, **recipient.context)
30+
headers = dict(m.headers, **recipient.headers)
3131
message_def = MessageDef(
3232
first_name=recipient.first_name,
3333
last_name=recipient.last_name,

src/spam/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_cache_key(self, m: EmailSendModel) -> str:
8484

8585
async def get(self, m: EmailSendModel) -> Optional[SpamCheckResult]:
8686
key = self.get_cache_key(m)
87-
cached_data = await self.redis.get(key)
87+
cached_data: Optional[str] = await self.redis.get(key)
8888
if cached_data:
8989
return SpamCheckResult.parse_raw(cached_data)
9090
return None

0 commit comments

Comments
 (0)