Replace returnValue with return (#5736)

This commit is contained in:
Amber Brown 2019-07-23 23:00:55 +10:00 committed by GitHub
parent 18a466b84e
commit 4806651744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
177 changed files with 1359 additions and 1513 deletions

View file

@ -307,15 +307,13 @@ class GroupServerStore(SQLBaseStore):
desc="get_group_categories",
)
defer.returnValue(
{
row["category_id"]: {
"is_public": row["is_public"],
"profile": json.loads(row["profile"]),
}
for row in rows
return {
row["category_id"]: {
"is_public": row["is_public"],
"profile": json.loads(row["profile"]),
}
)
for row in rows
}
@defer.inlineCallbacks
def get_group_category(self, group_id, category_id):
@ -328,7 +326,7 @@ class GroupServerStore(SQLBaseStore):
category["profile"] = json.loads(category["profile"])
defer.returnValue(category)
return category
def upsert_group_category(self, group_id, category_id, profile, is_public):
"""Add/update room category for group
@ -370,15 +368,13 @@ class GroupServerStore(SQLBaseStore):
desc="get_group_roles",
)
defer.returnValue(
{
row["role_id"]: {
"is_public": row["is_public"],
"profile": json.loads(row["profile"]),
}
for row in rows
return {
row["role_id"]: {
"is_public": row["is_public"],
"profile": json.loads(row["profile"]),
}
)
for row in rows
}
@defer.inlineCallbacks
def get_group_role(self, group_id, role_id):
@ -391,7 +387,7 @@ class GroupServerStore(SQLBaseStore):
role["profile"] = json.loads(role["profile"])
defer.returnValue(role)
return role
def upsert_group_role(self, group_id, role_id, profile, is_public):
"""Add/remove user role
@ -960,7 +956,7 @@ class GroupServerStore(SQLBaseStore):
_register_user_group_membership_txn,
next_id,
)
defer.returnValue(res)
return res
@defer.inlineCallbacks
def create_group(
@ -1057,9 +1053,9 @@ class GroupServerStore(SQLBaseStore):
now = int(self._clock.time_msec())
if row and now < row["valid_until_ms"]:
defer.returnValue(json.loads(row["attestation_json"]))
return json.loads(row["attestation_json"])
defer.returnValue(None)
return None
def get_joined_groups(self, user_id):
return self._simple_select_onecol(