From ed76a8ae8df4c971baf4ea6cbdd8688b21ced98c Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 13 Apr 2020 20:51:29 +0200 Subject: [PATCH] reformat --- app/models.py | 9 +++++---- email_handler.py | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models.py b/app/models.py index 30ab481f..124519d3 100644 --- a/app/models.py +++ b/app/models.py @@ -252,14 +252,15 @@ class User(db.Model, ModelMixin, UserMixin): manual_sub: ManualSubscription = ManualSubscription.get_by(user_id=self.id) # user who has giveaway premium can decide to upgrade - if manual_sub and manual_sub.end_at > arrow.now() and not manual_sub.is_giveaway: + if ( + manual_sub + and manual_sub.end_at > arrow.now() + and not manual_sub.is_giveaway + ): return False return True - - - def next_bill_date(self) -> str: sub: Subscription = self.get_subscription() if sub: diff --git a/email_handler.py b/email_handler.py index 46d922ad..ba0dd7cc 100644 --- a/email_handler.py +++ b/email_handler.py @@ -86,6 +86,7 @@ from server import create_app # can happen when user "Reply All" on some email clients _SELF_FORWARDING_STATUS = "550 SL self-forward" + # fix the database connection leak issue # use this method instead of create_app def new_app():