From f3a89626123df70a217c99d88ea07a06d72643fe Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Sat, 4 Jun 2016 03:38:20 +0530 Subject: [PATCH] Replace make_dict() with stream.to_dict(). --- zerver/lib/actions.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index a2c3b795ce..37aff14e86 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -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