fix: handle None autopay_days_before in autopayment processing

Existing subscriptions may have NULL autopay_days_before in DB,
causing TypeError in min(None, 3). Default to 3 when None.
This commit is contained in:
Fringg
2026-03-18 21:16:08 +03:00
parent b40a812f3a
commit f1d45343e9
+1 -1
View File
@@ -1023,7 +1023,7 @@ class MonitoringService:
continue
days_before_expiry = (sub.end_date - current_time).days
if days_before_expiry <= min(sub.autopay_days_before, 3):
if days_before_expiry <= min(sub.autopay_days_before or 3, 3):
autopay_subscriptions.append(sub)
processed_count = 0