mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-06 06:27:52 -05:00
Fix search_user_dir multiple sqlite versions do different things
This commit is contained in:
parent
a9cb1a35c8
commit
545001b9e4
@ -667,7 +667,7 @@ class UserDirectoryStore(SQLBaseStore):
|
|||||||
# The array of numbers are the weights for the various part of the
|
# The array of numbers are the weights for the various part of the
|
||||||
# search: (domain, _, display name, localpart)
|
# search: (domain, _, display name, localpart)
|
||||||
sql = """
|
sql = """
|
||||||
SELECT d.user_id, display_name, avatar_url
|
SELECT d.user_id AS user_id, display_name, avatar_url
|
||||||
FROM user_directory_search
|
FROM user_directory_search
|
||||||
INNER JOIN user_directory AS d USING (user_id)
|
INNER JOIN user_directory AS d USING (user_id)
|
||||||
%s
|
%s
|
||||||
@ -702,7 +702,7 @@ class UserDirectoryStore(SQLBaseStore):
|
|||||||
search_query = _parse_query_sqlite(search_term)
|
search_query = _parse_query_sqlite(search_term)
|
||||||
|
|
||||||
sql = """
|
sql = """
|
||||||
SELECT d.user_id, display_name, avatar_url
|
SELECT d.user_id AS user_id, display_name, avatar_url
|
||||||
FROM user_directory_search
|
FROM user_directory_search
|
||||||
INNER JOIN user_directory AS d USING (user_id)
|
INNER JOIN user_directory AS d USING (user_id)
|
||||||
%s
|
%s
|
||||||
|
@ -62,7 +62,7 @@ class UserDirectoryStoreTestCase(unittest.TestCase):
|
|||||||
self.assertFalse(r["limited"])
|
self.assertFalse(r["limited"])
|
||||||
self.assertEqual(1, len(r["results"]))
|
self.assertEqual(1, len(r["results"]))
|
||||||
self.assertDictEqual(r["results"][0], {
|
self.assertDictEqual(r["results"][0], {
|
||||||
"d.user_id": BOB,
|
"user_id": BOB,
|
||||||
"display_name": "bob",
|
"display_name": "bob",
|
||||||
"avatar_url": None,
|
"avatar_url": None,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user