Used another logger.

This commit is contained in:
s3lph 2018-09-09 03:23:19 +02:00
parent 37498f9ab7
commit a466e5109f
2 changed files with 2 additions and 3 deletions

View file

@ -577,8 +577,7 @@ class MatematDatabase(object):
# Reflect the change in the user object # Reflect the change in the user object
user.balance = old_balance + amount user.balance = old_balance + amount
def check_receipt_due(self, user: User) -> bool: def check_receipt_due(self, user: User, logger: logging.Logger) -> bool:
logger = logging.getLogger('matemat.db.facage.check_receipt_due')
if not isinstance(user.receipt_pref, ReceiptPreference): if not isinstance(user.receipt_pref, ReceiptPreference):
raise TypeError() raise TypeError()
if user.receipt_pref == ReceiptPreference.NONE or user.email is None: if user.receipt_pref == ReceiptPreference.NONE or user.email is None:

View file

@ -28,7 +28,7 @@ def receipt_smtp_cron(config: Dict[str, str],
for user in users: for user in users:
if user.email is None: if user.email is None:
logger.debug('User "%s" has no e-mail address.', user.name) 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) logger.info('Generating receipt for user "%s".', user.name)
# Generate receipts that are due # Generate receipts that are due
receipt: Receipt = db.create_receipt(user, write=True) receipt: Receipt = db.create_receipt(user, write=True)