mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:56:06 -04:00
Consistently use six's iteritems and wrap lazy keys/values in list() if they're not meant to be lazy (#3307)
This commit is contained in:
parent
872cf43516
commit
c936a52a9e
29 changed files with 116 additions and 101 deletions
|
@ -22,6 +22,8 @@ from synapse.api.constants import EventTypes, JoinRules
|
|||
from synapse.storage.engines import PostgresEngine, Sqlite3Engine
|
||||
from synapse.types import get_domain_from_id, get_localpart_from_id
|
||||
|
||||
from six import iteritems
|
||||
|
||||
import re
|
||||
import logging
|
||||
|
||||
|
@ -100,7 +102,7 @@ class UserDirectoryStore(SQLBaseStore):
|
|||
user_id, get_localpart_from_id(user_id), get_domain_from_id(user_id),
|
||||
profile.display_name,
|
||||
)
|
||||
for user_id, profile in users_with_profile.iteritems()
|
||||
for user_id, profile in iteritems(users_with_profile)
|
||||
)
|
||||
elif isinstance(self.database_engine, Sqlite3Engine):
|
||||
sql = """
|
||||
|
@ -112,7 +114,7 @@ class UserDirectoryStore(SQLBaseStore):
|
|||
user_id,
|
||||
"%s %s" % (user_id, p.display_name,) if p.display_name else user_id
|
||||
)
|
||||
for user_id, p in users_with_profile.iteritems()
|
||||
for user_id, p in iteritems(users_with_profile)
|
||||
)
|
||||
else:
|
||||
# This should be unreachable.
|
||||
|
@ -130,7 +132,7 @@ class UserDirectoryStore(SQLBaseStore):
|
|||
"display_name": profile.display_name,
|
||||
"avatar_url": profile.avatar_url,
|
||||
}
|
||||
for user_id, profile in users_with_profile.iteritems()
|
||||
for user_id, profile in iteritems(users_with_profile)
|
||||
]
|
||||
)
|
||||
for user_id in users_with_profile:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue