update prints to log
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user