mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
Application model use
This commit is contained in:
parent
a3c5cf452c
commit
dd621b59b9
|
|
@ -107,8 +107,8 @@ def is_valid_credential(provider, model_type, model_name, model_credential: Dict
|
|||
def get_model_by_id(_id, workspace_id):
|
||||
model = QuerySet(Model).filter(id=_id).first()
|
||||
get_authorized_model = DatabaseModelManage.get_model("get_authorized_model")
|
||||
if get_authorized_model is not None:
|
||||
model = get_authorized_model(model, workspace_id)
|
||||
if model and model.workspace_id!=workspace_id and get_authorized_model is not None:
|
||||
model = get_authorized_model(QuerySet(Model).filter(id=_id), workspace_id).first()
|
||||
if model is None:
|
||||
raise Exception(_("Model does not exist"))
|
||||
return model
|
||||
|
|
|
|||
Loading…
Reference in New Issue