Used another logger.
This commit is contained in:
parent
37498f9ab7
commit
a466e5109f
2 changed files with 2 additions and 3 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue