update prints to log

This commit is contained in:
Parsa Nazer
2026-05-12 09:47:45 +03:30
parent 45fe9c1f4c
commit e5d940e3c9
9 changed files with 44 additions and 29 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
from django.db import models
from account.models import User
import logging
logger = logging.getLogger(__name__)
from product.models import ProductModel
from django.conf import settings
import openai
@@ -55,7 +58,7 @@ class ProductChatModel(models.Model):
self.thread = thread.id
except Exception as e:
print(f'error in chat class: {e}')
logger.error(f'error in chat class: {e}')
raise ValueError(f"Error creating OpenAI thread: {e}")
super().save(*args, **kwargs)