feat: add logger to record generated OTP verification codes

This commit is contained in:
Suherdy Yacob 2026-06-13 18:43:34 +07:00
parent aa2694020d
commit b6684e34ad

View File

@ -1,8 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import random import random
import logging
from datetime import datetime, timedelta from datetime import datetime, timedelta
from odoo import api, fields, models from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class LoyaltyVerificationOtp(models.Model): class LoyaltyVerificationOtp(models.Model):
_name = 'loyalty.verification.otp' _name = 'loyalty.verification.otp'
_description = 'Loyalty Verification OTP' _description = 'Loyalty Verification OTP'
@ -37,6 +40,8 @@ class LoyaltyVerificationOtp(models.Model):
'otp_type': otp_type, 'otp_type': otp_type,
}) })
_logger.info("Generated OTP verification code [%s] for contact %s (Type: %s)", otp_code, email or phone, otp_type)
# Send Email # Send Email
if email: if email:
subject = "Verification Code - Mie Mapan" subject = "Verification Code - Mie Mapan"