KevinHuSh
commited on
Commit
·
d1a22ef
1
Parent(s):
83bd6a2
fix bugs in searching file using keywords (#780)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
api/db/services/file_service.py
CHANGED
@@ -34,9 +34,9 @@ class FileService(CommonService):
|
|
34 |
orderby, desc, keywords):
|
35 |
if keywords:
|
36 |
files = cls.model.select().where(
|
37 |
-
(cls.model.tenant_id == tenant_id)
|
38 |
(cls.model.parent_id == pf_id),
|
39 |
-
(fn.LOWER(cls.model.name).
|
40 |
~(cls.model.id == pf_id)
|
41 |
)
|
42 |
else:
|
|
|
34 |
orderby, desc, keywords):
|
35 |
if keywords:
|
36 |
files = cls.model.select().where(
|
37 |
+
(cls.model.tenant_id == tenant_id),
|
38 |
(cls.model.parent_id == pf_id),
|
39 |
+
(fn.LOWER(cls.model.name).contains(keywords.lower())),
|
40 |
~(cls.model.id == pf_id)
|
41 |
)
|
42 |
else:
|
api/db/services/task_service.py
CHANGED
@@ -96,7 +96,7 @@ class TaskService(CommonService):
|
|
96 |
return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
|
97 |
except Exception as e:
|
98 |
pass
|
99 |
-
return
|
100 |
|
101 |
@classmethod
|
102 |
@DB.connection_context()
|
|
|
96 |
return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
|
97 |
except Exception as e:
|
98 |
pass
|
99 |
+
return False
|
100 |
|
101 |
@classmethod
|
102 |
@DB.connection_context()
|