Compare commits

...

4 Commits

Author SHA1 Message Date
H. Shay
af4df2f639 lints 2023-07-18 15:56:12 -07:00
H. Shay
e0384a1f78 Merge branch 'develop' into shay/more_no_read 2023-07-18 15:42:01 -07:00
H. Shay
2c3f20e28a really stop reading from user_id 2023-07-18 15:41:41 -07:00
Olivier Wilkinson (reivilibre)
e30282bd15 1.88.0 2023-07-18 15:06:07 -07:00
3 changed files with 8 additions and 8 deletions

View File

@@ -697,7 +697,7 @@ class StatsStore(StateDeltasStore):
txn: LoggingTransaction,
) -> Tuple[List[JsonDict], int]:
filters = []
args = [self.hs.config.server.server_name]
args: list = []
if search_term:
filters.append("(lmr.user_id LIKE ? OR displayname LIKE ?)")
@@ -733,7 +733,7 @@ class StatsStore(StateDeltasStore):
sql_base = """
FROM local_media_repository as lmr
LEFT JOIN profiles AS p ON lmr.user_id = '@' || p.user_id || ':' || ?
LEFT JOIN profiles AS p ON lmr.user_id = p.full_user_id
{}
GROUP BY lmr.user_id, displayname
""".format(

View File

@@ -414,18 +414,18 @@ class UserDirectoryBackgroundUpdateStore(StateDeltasStore):
profile_rows = self.db_pool.simple_select_many_txn(
txn,
table="profiles",
column="user_id",
iterable=[get_localpart_from_id(u) for u in users_to_insert],
column="full_user_id",
iterable=list(users_to_insert),
retcols=(
"user_id",
"full_user_id",
"displayname",
"avatar_url",
),
keyvalues={},
)
profiles = {
f"@{row['user_id']}:{self.server_name}": _UserDirProfile(
f"@{row['user_id']}:{self.server_name}",
row["full_user_id"]: _UserDirProfile(
row["full_user_id"],
row["displayname"],
row["avatar_url"],
)

View File

@@ -1418,7 +1418,7 @@ class DeactivateAccountTestCase(unittest.HomeserverTestCase):
# To test deactivation for users without a profile, we delete the profile information for our user.
self.get_success(
self.store.db_pool.simple_delete_one(
table="profiles", keyvalues={"user_id": "user"}
table="profiles", keyvalues={"full_user_id": "@user:test"}
)
)