refactor(devices): update device payment status in background task and remove unused serializer field 🔨

This commit is contained in:
2025-07-09 21:55:22 +05:00
parent 6418b1469d
commit e2ede37f4f
2 changed files with 3 additions and 16 deletions

View File

@ -72,6 +72,9 @@ def update_expired_payments(timestamp: int):
logger.info(f"Found {count} payments to expire.")
for payment in expired_payments_qs:
for device in payment.devices.all():
device.has_a_pending_payment = False
device.save()
if (
payment.user
and payment.user.mobile