Skip to content

Commit dd621b5

Browse files
committed
Application model use
1 parent a3c5cf4 commit dd621b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/models_provider/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def is_valid_credential(provider, model_type, model_name, model_credential: Dict
107107
def get_model_by_id(_id, workspace_id):
108108
model = QuerySet(Model).filter(id=_id).first()
109109
get_authorized_model = DatabaseModelManage.get_model("get_authorized_model")
110-
if get_authorized_model is not None:
111-
model = get_authorized_model(model, workspace_id)
110+
if model and model.workspace_id!=workspace_id and get_authorized_model is not None:
111+
model = get_authorized_model(QuerySet(Model).filter(id=_id), workspace_id).first()
112112
if model is None:
113113
raise Exception(_("Model does not exist"))
114114
return model

0 commit comments

Comments
 (0)