From c2546cb0de1a41084097143da5313e879e394dad Mon Sep 17 00:00:00 2001 From: Son NK Date: Fri, 8 Nov 2019 07:55:29 +0100 Subject: [PATCH] fix test --- app/models.py | 2 ++ email_handler.py | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/models.py b/app/models.py index 7fb06e1b..b1d81322 100644 --- a/app/models.py +++ b/app/models.py @@ -541,3 +541,5 @@ class ForwardEmail(db.Model, ModelMixin): # this reply email is created every time a website sends an email to user # it has the prefix "reply+" to distinguish with other email reply_email = db.Column(db.String(128), nullable=False) + + gen_email = db.relationship(GenEmail) diff --git a/email_handler.py b/email_handler.py index a1010728..8b732d54 100644 --- a/email_handler.py +++ b/email_handler.py @@ -136,10 +136,11 @@ class MailHandler: return "250 Message accepted for delivery" -controller = Controller(MailHandler(), hostname="localhost", port=20381) +if __name__ == "__main__": + controller = Controller(MailHandler(), hostname="localhost", port=20381) -controller.start() -print(">>", controller.hostname, controller.port) + controller.start() + print(">>", controller.hostname, controller.port) -while True: - time.sleep(10) + while True: + time.sleep(10)