From a466e5109fc95c81d74622457069b0d0e20f07ed Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 9 Sep 2018 03:23:19 +0200 Subject: [PATCH] Used another logger. --- matemat/db/facade.py | 3 +-- matemat/webserver/pagelets/receipt_smtp_cron.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/matemat/db/facade.py b/matemat/db/facade.py index d3ff681..80020fd 100644 --- a/matemat/db/facade.py +++ b/matemat/db/facade.py @@ -577,8 +577,7 @@ class MatematDatabase(object): # Reflect the change in the user object user.balance = old_balance + amount - def check_receipt_due(self, user: User) -> bool: - logger = logging.getLogger('matemat.db.facage.check_receipt_due') + def check_receipt_due(self, user: User, logger: logging.Logger) -> bool: if not isinstance(user.receipt_pref, ReceiptPreference): raise TypeError() if user.receipt_pref == ReceiptPreference.NONE or user.email is None: diff --git a/matemat/webserver/pagelets/receipt_smtp_cron.py b/matemat/webserver/pagelets/receipt_smtp_cron.py index 0df5d77..ad03c71 100644 --- a/matemat/webserver/pagelets/receipt_smtp_cron.py +++ b/matemat/webserver/pagelets/receipt_smtp_cron.py @@ -28,7 +28,7 @@ def receipt_smtp_cron(config: Dict[str, str], for user in users: if user.email is None: logger.debug('User "%s" has no e-mail address.', user.name) - if db.check_receipt_due(user): + if db.check_receipt_due(user, logger): logger.info('Generating receipt for user "%s".', user.name) # Generate receipts that are due receipt: Receipt = db.create_receipt(user, write=True)