Merge pull request 'backslash-fix: убрал бэкслешевые ошибки' (#129) from backslash-fix into test
Reviewed-on: #129
This commit is contained in:
commit
fdc03457d0
@ -64,8 +64,9 @@ class ProjectRepository:
|
|||||||
if status_in is not None:
|
if status_in is not None:
|
||||||
query = query.where(Project.status.in_(status_in))
|
query = query.where(Project.status.in_(status_in))
|
||||||
if search is not None and (normalized_search := search.strip()):
|
if search is not None and (normalized_search := search.strip()):
|
||||||
|
normalized_search = normalized_search.replace('\\', '\\\\').replace('%', '\\%').replace('_', '\\_')
|
||||||
search_pattern = (
|
search_pattern = (
|
||||||
f"%{normalized_search.replace('\\', '\\\\').replace('%', '\\%').replace('_', '\\_')}%"
|
f"%{normalized_search}%"
|
||||||
)
|
)
|
||||||
matching_year_exists = exists(
|
matching_year_exists = exists(
|
||||||
select(1)
|
select(1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user