mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Use a generator instead of a list
This commit is contained in:
parent
5b48eec4a1
commit
9d83d52027
@ -275,11 +275,11 @@ class ApplicationService(object):
|
|||||||
def get_groups_for_user(self, user_id):
|
def get_groups_for_user(self, user_id):
|
||||||
"""Get the groups that this user is associated with by this AS
|
"""Get the groups that this user is associated with by this AS
|
||||||
"""
|
"""
|
||||||
return [
|
return (
|
||||||
regex_obj["group_id"]
|
regex_obj["group_id"]
|
||||||
for regex_obj in self.namespaces[ApplicationService.NS_USERS]
|
for regex_obj in self.namespaces[ApplicationService.NS_USERS]
|
||||||
if "group_id" in regex_obj and regex_obj["regex"].match(user_id)
|
if "group_id" in regex_obj and regex_obj["regex"].match(user_id)
|
||||||
]
|
)
|
||||||
|
|
||||||
def is_rate_limited(self):
|
def is_rate_limited(self):
|
||||||
return self.rate_limited
|
return self.rate_limited
|
||||||
|
Loading…
Reference in New Issue
Block a user