From 10effefff551b8a6701b06721a1b6a1b64baa640 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Sat, 7 Jun 2025 17:27:30 +0300 Subject: [PATCH] Fixes: add_product for Order --- core/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/models.py b/core/models.py index 6bbc12d7..4631a2a0 100644 --- a/core/models.py +++ b/core/models.py @@ -1,7 +1,7 @@ import datetime import json import logging -from typing import Self +from typing import Optional, Self from constance import config from django.contrib.gis.db.models import PointField @@ -550,7 +550,8 @@ class Order(ExportModelOperationsMixin("order"), NiceModel): def total_quantity(self) -> int: return sum([op.quantity for op in self.order_products.all()]) - def add_product(self, product_uuid: str | None = None, attributes: list = None, update_quantity: bool = True): + def add_product(self, product_uuid: str | None = None, attributes: Optional[list] = None, + update_quantity: bool = True): if attributes is None: attributes = []