mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Replace make_dict() with stream.to_dict().
This commit is contained in:
@@ -3197,16 +3197,7 @@ def do_get_streams(user_profile, include_public=True, include_subscribed=True,
|
|||||||
# We're including nothing, so don't bother hitting the DB.
|
# We're including nothing, so don't bother hitting the DB.
|
||||||
query = []
|
query = []
|
||||||
|
|
||||||
def make_dict(row):
|
streams = [(row.to_dict()) for row in query]
|
||||||
# type: (Stream) -> Dict[str, Any]
|
|
||||||
return dict(
|
|
||||||
stream_id = row.id,
|
|
||||||
name = row.name,
|
|
||||||
description = row.description,
|
|
||||||
invite_only = row.invite_only,
|
|
||||||
)
|
|
||||||
|
|
||||||
streams = [make_dict(row) for row in query]
|
|
||||||
streams.sort(key=lambda elt: elt["name"])
|
streams.sort(key=lambda elt: elt["name"])
|
||||||
|
|
||||||
return streams
|
return streams
|
||||||
|
|||||||
Reference in New Issue
Block a user