We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b10ed71 commit 3f076f3Copy full SHA for 3f076f3
1 file changed
src/webapp/routers/models.py
@@ -320,13 +320,22 @@ def delete_model(
320
) -> Any:
321
transformed_model_name = str(decode_url_piece(model_name)).strip()
322
has_access_to_inst_or_err(inst_id, current_user)
323
- model_owner_and_higher_or_err(current_user, "modify batch")
324
325
local_session.set(sql_session)
326
sess = local_session.get()
327
+ query_result = sess.execute(
328
+ select(ModelTable).where(
329
+ and_(
330
+ ModelTable.name == transformed_model_name,
331
+ ModelTable.inst_id == str_to_uuid(inst_id),
332
+ )
333
334
+ ).all()
335
+
336
model_list = sess.execute(
337
select(ModelTable).where(
338
+ ModelTable.id == query_result[0][0].id,
339
ModelTable.name == transformed_model_name,
340
ModelTable.inst_id == str_to_uuid(inst_id),
341
)
0 commit comments