From 6363f3ffd7943858d62ccbde35ac8c684de26afd Mon Sep 17 00:00:00 2001 From: ivan deng Date: Thu, 6 Apr 2023 22:57:39 +0800 Subject: [PATCH] fix gpt --- app_chatgpt/models/mail_channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_chatgpt/models/mail_channel.py b/app_chatgpt/models/mail_channel.py index d789ca2f..3c1a530f 100644 --- a/app_chatgpt/models/mail_channel.py +++ b/app_chatgpt/models/mail_channel.py @@ -62,7 +62,7 @@ class Channel(models.Model): channel_partner_ids = self.channel_partner_ids to_partner_id = channel_partner_ids - message.author_id user_id = to_partner_id.mapped('user_ids').filtered(lambda r: r.gpt_id)[:1] - if user_id: + if user_id and to_partner_id.gpt_id: gpt_policy = user_id.gpt_policy gpt_wl_users = user_id.gpt_wl_users is_allow = message.create_uid.id in gpt_wl_users.ids