Features: ;

Fixes: 1) Correct logical condition to check if product_uuid is in recently_viewed;

Extra: ;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-05-19 15:10:12 +03:00
parent 3590dbbe2b
commit d6f178acb6

View file

@ -76,7 +76,7 @@ class User(AbstractUser, NiceModel):
def add_to_recently_viewed(self, product_uuid):
recently_viewed = self.recently_viewed
if not product_uuid in recently_viewed:
if product_uuid not in recently_viewed:
if not len(recently_viewed) >= 48:
recently_viewed.append(product_uuid)
cache.set(f"user_{self.uuid}_rv", recently_viewed)