fix: task models issue
This commit is contained in:
@@ -152,7 +152,7 @@
|
|||||||
if (taskConfig.TASK_MODEL) {
|
if (taskConfig.TASK_MODEL) {
|
||||||
const model = models.find((m) => m.id === taskConfig.TASK_MODEL);
|
const model = models.find((m) => m.id === taskConfig.TASK_MODEL);
|
||||||
if (model) {
|
if (model) {
|
||||||
if (model?.access_control !== null) {
|
if (model?.access_grants && !model.access_grants.some((g) => g.principal_type === 'user' && g.principal_id === '*' && g.permission === 'read')) {
|
||||||
toast.error(
|
toast.error(
|
||||||
$i18n.t(
|
$i18n.t(
|
||||||
'This model is not publicly available. Please select another model.'
|
'This model is not publicly available. Please select another model.'
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
if (taskConfig.TASK_MODEL_EXTERNAL) {
|
if (taskConfig.TASK_MODEL_EXTERNAL) {
|
||||||
const model = models.find((m) => m.id === taskConfig.TASK_MODEL_EXTERNAL);
|
const model = models.find((m) => m.id === taskConfig.TASK_MODEL_EXTERNAL);
|
||||||
if (model) {
|
if (model) {
|
||||||
if (model?.access_control !== null) {
|
if (model?.access_grants && !model.access_grants.some((g) => g.principal_type === 'user' && g.principal_id === '*' && g.permission === 'read')) {
|
||||||
toast.error(
|
toast.error(
|
||||||
$i18n.t(
|
$i18n.t(
|
||||||
'This model is not publicly available. Please select another model.'
|
'This model is not publicly available. Please select another model.'
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
name: model.name,
|
name: model.name,
|
||||||
base_model_id: null,
|
base_model_id: null,
|
||||||
params: {},
|
params: {},
|
||||||
access_control: {},
|
access_grants: [],
|
||||||
...model
|
...model
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
return null;
|
return null;
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
base_model_id: null,
|
base_model_id: null,
|
||||||
meta: {},
|
meta: {},
|
||||||
params: {},
|
params: {},
|
||||||
access_control: {},
|
access_grants: [],
|
||||||
is_active: model.is_active
|
is_active: model.is_active
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user