mirror of https://github.com/zulip/zulip.git
home.py: move people_list as realm_users to register_ret.
Simplify the page_params generation logic #3853
This commit is contained in:
parent
7db8c61aac
commit
78bcbc79d6
|
@ -1,7 +1,7 @@
|
|||
global.stub_out_jquery();
|
||||
|
||||
set_global('page_params', {
|
||||
people_list: [],
|
||||
realm_users: [],
|
||||
});
|
||||
|
||||
set_global('feature_flags', {});
|
||||
|
|
|
@ -11,7 +11,7 @@ set_global('window', {
|
|||
});
|
||||
|
||||
set_global('page_params', {
|
||||
people_list: [],
|
||||
realm_users: [],
|
||||
realm_emoji: {
|
||||
burrito: {display_url: '/static/generated/emoji/images/emoji/burrito.png',
|
||||
source_url: '/static/generated/emoji/images/emoji/burrito.png'},
|
||||
|
|
|
@ -2,7 +2,7 @@ global.stub_out_jquery();
|
|||
|
||||
set_global('page_params', {
|
||||
is_admin: false,
|
||||
people_list: [],
|
||||
realm_users: [],
|
||||
});
|
||||
|
||||
add_dependencies({
|
||||
|
|
|
@ -680,7 +680,7 @@ exports.is_my_user_id = function (user_id) {
|
|||
};
|
||||
|
||||
$(function () {
|
||||
_.each(page_params.people_list, function (person) {
|
||||
_.each(page_params.realm_users, function (person) {
|
||||
exports.add_in_realm(person);
|
||||
});
|
||||
|
||||
|
@ -693,7 +693,7 @@ $(function () {
|
|||
|
||||
exports.initialize_current_user(page_params.user_id);
|
||||
|
||||
delete page_params.people_list; // We are the only consumer of this.
|
||||
delete page_params.realm_users; // We are the only consumer of this.
|
||||
delete page_params.cross_realm_bots;
|
||||
});
|
||||
|
||||
|
|
|
@ -87,7 +87,6 @@ class HomeTest(ZulipTestCase):
|
|||
"needs_tutorial",
|
||||
"never_subscribed",
|
||||
"notifications_stream",
|
||||
"people_list",
|
||||
"pm_content_in_desktop_notifications",
|
||||
"poll_timeout",
|
||||
"presences",
|
||||
|
@ -123,6 +122,7 @@ class HomeTest(ZulipTestCase):
|
|||
"realm_restricted_to_domain",
|
||||
"realm_show_digest_email",
|
||||
"realm_uri",
|
||||
"realm_users",
|
||||
"realm_waiting_period_threshold",
|
||||
"referrals",
|
||||
"save_stacktraces",
|
||||
|
@ -316,8 +316,8 @@ class HomeTest(ZulipTestCase):
|
|||
self.login(email)
|
||||
result = self._get_home_page()
|
||||
page_params = self._get_page_params(result)
|
||||
for params in ['people_list', 'realm_bots']:
|
||||
users = page_params['people_list']
|
||||
for params in ['realm_users', 'realm_bots']:
|
||||
users = page_params['realm_users']
|
||||
self.assertTrue(len(users) >= 3)
|
||||
for user in users:
|
||||
self.assertEqual(user['user_id'],
|
||||
|
|
|
@ -240,7 +240,6 @@ def home_real(request):
|
|||
|
||||
# Realm foreign key data from register_ret.
|
||||
# TODO: Rename these to match register_ret values.
|
||||
people_list = register_ret['realm_users'],
|
||||
initial_pointer = register_ret['pointer'],
|
||||
|
||||
# Misc. extra data.
|
||||
|
@ -306,6 +305,7 @@ def home_real(request):
|
|||
'realm_restricted_to_domain',
|
||||
'realm_show_digest_email',
|
||||
'realm_uri',
|
||||
'realm_users',
|
||||
'realm_waiting_period_threshold',
|
||||
'referrals',
|
||||
'subscriptions',
|
||||
|
|
Loading…
Reference in New Issue