Преглед изворни кода

fix bugs in searching file using keywords (#780)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.6.0
KevinHuSh пре 1 година
родитељ
комит
d8c080ee52
No account linked to committer's email address
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 2
    2
      api/db/services/file_service.py
  2. 1
    1
      api/db/services/task_service.py

+ 2
- 2
api/db/services/file_service.py Прегледај датотеку

orderby, desc, keywords): orderby, desc, keywords):
if keywords: if keywords:
files = cls.model.select().where( files = cls.model.select().where(
(cls.model.tenant_id == tenant_id)
(cls.model.tenant_id == tenant_id),
(cls.model.parent_id == pf_id), (cls.model.parent_id == pf_id),
(fn.LOWER(cls.model.name).like(f"%%{keywords.lower()}%%")),
(fn.LOWER(cls.model.name).contains(keywords.lower())),
~(cls.model.id == pf_id) ~(cls.model.id == pf_id)
) )
else: else:

+ 1
- 1
api/db/services/task_service.py Прегледај датотеку

return doc.run == TaskStatus.CANCEL.value or doc.progress < 0 return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
except Exception as e: except Exception as e:
pass pass
return True
return False
@classmethod @classmethod
@DB.connection_context() @DB.connection_context()

Loading…
Откажи
Сачувај