fix error if max_extend=None

This commit is contained in:
Mira Weller
2025-05-16 22:34:24 +02:00
parent 43a96ed3fa
commit 2d8910e797

View File

@@ -229,7 +229,7 @@ class CartMixin:
try:
first_expiry = min(p.expires for p in positions) if positions else now()
max_expiry_extend = min(p.max_extend for p in positions) if positions else now()
max_expiry_extend = min((p.max_extend for p in positions if p.max_extend), default=None)
total_seconds_left = max(first_expiry - now(), timedelta()).total_seconds()
minutes_left = int(total_seconds_left // 60)
seconds_left = int(total_seconds_left % 60)