mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Fix sending error email on email ratelimit
This commit is contained in:
parent
004c5cd383
commit
deb5c02ce6
@ -70,10 +70,15 @@ class FlaskMailHandler(logging.Handler):
|
|||||||
return subject
|
return subject
|
||||||
|
|
||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
|
subject = self.getSubject(record)
|
||||||
text = self.format(record) if self.formatter else None
|
text = self.format(record) if self.formatter else None
|
||||||
html = "<pre>{}</pre>".format(text)
|
html = "<pre>{}</pre>".format(text)
|
||||||
|
|
||||||
|
if "The recipient has exceeded message rate limit. Try again later" in subject:
|
||||||
|
return
|
||||||
|
|
||||||
for email in self.send_to:
|
for email in self.send_to:
|
||||||
send_user_email.delay(email, "en", self.getSubject(record), text, html)
|
send_user_email.delay(email, "en", subject, text, html)
|
||||||
|
|
||||||
|
|
||||||
def build_handler(app):
|
def build_handler(app):
|
||||||
|
Loading…
Reference in New Issue
Block a user