From 22bab1c7ec82135a471993da20c9dacdf176b639 Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Fri, 15 Sep 2017 04:46:05 +0530 Subject: [PATCH] events: Add upload_quota to initial state data. --- zerver/lib/events.py | 3 +++ zerver/tests/test_home.py | 1 + 2 files changed, 4 insertions(+) diff --git a/zerver/lib/events.py b/zerver/lib/events.py index 693f410570..0faa5b1ae3 100644 --- a/zerver/lib/events.py +++ b/zerver/lib/events.py @@ -81,6 +81,9 @@ def fetch_initial_state_data(user_profile, event_types, queue_id, if want('attachments'): state['attachments'] = user_attachments(user_profile) + if want('upload_quota'): + state['upload_quota'] = user_profile.quota + if want('total_uploads_size'): state['total_uploads_size'] = get_total_uploads_size_for_user(user_profile) diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py index efb9d7bdc5..0b48579d61 100644 --- a/zerver/tests/test_home.py +++ b/zerver/tests/test_home.py @@ -148,6 +148,7 @@ class HomeTest(ZulipTestCase): "twenty_four_hour_time", "unread_msgs", "unsubscribed", + "upload_quota", "use_websockets", "user_id", "zulip_version",