Replace make_dict() with stream.to_dict().

This commit is contained in:
Vishnu Ks
2016-06-04 03:38:20 +05:30
committed by Tim Abbott
parent 1844f1b054
commit f3a8962612

View File

@@ -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.
query = []
def make_dict(row):
# 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 = [(row.to_dict()) for row in query]
streams.sort(key=lambda elt: elt["name"])
return streams