Merge pull request 'tania_local' (#40) from tania_local into dev

Reviewed-on: freeleaps/freeleaps-service-hub#40
Reviewed-by: jingyao1991 <jingyao1991@noreply.gitea.freeleaps.mathmast.com>
This commit is contained in:
icecheng 2025-08-29 01:11:13 +00:00
commit 165e10c79d

View File

@ -58,9 +58,9 @@ class TenantNotificationManager:
raise InvalidDataError("All recipient emails are blacklisted")
# 3. check rate limit
rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email)
if not rate_limit_result["allowed"]:
raise InvalidDataError("Rate limit exceeded")
#rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email)
#if not rate_limit_result["allowed"]:
#raise InvalidDataError("Rate limit exceeded")
# 4. spam detection with region
email_content = {
@ -89,7 +89,7 @@ class TenantNotificationManager:
"invalid_recipients": invalid_recipients,
"invalid_sender": not valid_sender,
"blacklisted_recipients": blacklisted_recipients,
"rate_limit_info": rate_limit_result,
#"rate_limit_info": rate_limit_result,
"spam_detection_info": spam_result
}
}
@ -114,7 +114,7 @@ class TenantNotificationManager:
"invalid_recipients": invalid_recipients,
"invalid_sender": not valid_sender,
"blacklisted_recipients": blacklisted_recipients,
"rate_limit_info": rate_limit_result,
#"rate_limit_info": rate_limit_result,
"spam_detection_info": spam_result
}
}