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:
commit
165e10c79d
@ -58,9 +58,9 @@ class TenantNotificationManager:
|
|||||||
raise InvalidDataError("All recipient emails are blacklisted")
|
raise InvalidDataError("All recipient emails are blacklisted")
|
||||||
|
|
||||||
# 3. check rate limit
|
# 3. check rate limit
|
||||||
rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email)
|
#rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email)
|
||||||
if not rate_limit_result["allowed"]:
|
#if not rate_limit_result["allowed"]:
|
||||||
raise InvalidDataError("Rate limit exceeded")
|
#raise InvalidDataError("Rate limit exceeded")
|
||||||
|
|
||||||
# 4. spam detection with region
|
# 4. spam detection with region
|
||||||
email_content = {
|
email_content = {
|
||||||
@ -89,7 +89,7 @@ class TenantNotificationManager:
|
|||||||
"invalid_recipients": invalid_recipients,
|
"invalid_recipients": invalid_recipients,
|
||||||
"invalid_sender": not valid_sender,
|
"invalid_sender": not valid_sender,
|
||||||
"blacklisted_recipients": blacklisted_recipients,
|
"blacklisted_recipients": blacklisted_recipients,
|
||||||
"rate_limit_info": rate_limit_result,
|
#"rate_limit_info": rate_limit_result,
|
||||||
"spam_detection_info": spam_result
|
"spam_detection_info": spam_result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ class TenantNotificationManager:
|
|||||||
"invalid_recipients": invalid_recipients,
|
"invalid_recipients": invalid_recipients,
|
||||||
"invalid_sender": not valid_sender,
|
"invalid_sender": not valid_sender,
|
||||||
"blacklisted_recipients": blacklisted_recipients,
|
"blacklisted_recipients": blacklisted_recipients,
|
||||||
"rate_limit_info": rate_limit_result,
|
#"rate_limit_info": rate_limit_result,
|
||||||
"spam_detection_info": spam_result
|
"spam_detection_info": spam_result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user