mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-31 02:02:48 +00:00
fix: filter applications by publish status in chat step and node
This commit is contained in:
parent
018f4763ea
commit
edc8acda21
|
|
@ -269,7 +269,9 @@ class BaseChatStep(IChatStep):
|
|||
if application_ids and len(application_ids) > 0:
|
||||
self.context['application_ids'] = application_ids
|
||||
for application_id in application_ids:
|
||||
app = QuerySet(Application).filter(id=application_id).first()
|
||||
app = QuerySet(Application).filter(id=application_id, is_publish=True).first()
|
||||
if app is None:
|
||||
continue
|
||||
app_key = QuerySet(ApplicationApiKey).filter(application_id=application_id, is_active=True).first()
|
||||
if app_key is not None:
|
||||
api_key = app_key.secret_key
|
||||
|
|
|
|||
|
|
@ -256,7 +256,9 @@ class BaseChatNode(IChatNode):
|
|||
if application_ids and len(application_ids) > 0:
|
||||
self.context['application_ids'] = application_ids
|
||||
for application_id in application_ids:
|
||||
app = QuerySet(Application).filter(id=application_id).first()
|
||||
app = QuerySet(Application).filter(id=application_id, is_publish=True).first()
|
||||
if app is None:
|
||||
continue
|
||||
app_key = QuerySet(ApplicationApiKey).filter(application_id=application_id, is_active=True).first()
|
||||
if app_key is not None:
|
||||
api_key = app_key.secret_key
|
||||
|
|
|
|||
Loading…
Reference in New Issue