Compare commits

...

2 Commits

Author SHA1 Message Date
Pierre Ducroquet ac991e24c0 broken on purpose
gitea/wcs/pipeline/head There was a failure building this commit Details
2024-03-05 10:28:41 +01:00
Pierre Ducroquet 9579bb241d test new behaviour 2024-03-05 10:28:31 +01:00
2 changed files with 4 additions and 1 deletions

View File

@ -429,6 +429,9 @@ def test_backoffice_submission_formdef_list_search(pub, local_user, access, auth
resp = get_url('/api/formdefs/?backoffice-submission=on&q=test')
assert len(resp.json['data']) == 2
resp = get_url('/api/formdefs/?backoffice-submission=on&q=tes')
assert len(resp.json['data']) == 2
resp = get_url('/api/formdefs/?backoffice-submission=on&q=xyz')
assert len(resp.json['data']) == 0

View File

@ -4995,7 +4995,7 @@ class SearchableFormDef(SqlMixin):
def search(cls, obj_type, string):
_, cur = get_connection_and_cursor()
cur.execute(
'SELECT object_id FROM searchable_formdefs WHERE fts @@ wcs_tsquery(%s) AND false',
'SELECT object_id FROM searchable_formdefs WHERE fts @@ plainto_tsquery(%s)',
(FtsMatch.get_fts_value(string),),
)
ids = [x[0] for x in cur.fetchall()]