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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user