mirror of https://github.com/zulip/zulip.git
profile: Send field types to client side.
This commit is contained in:
parent
f6fb88549f
commit
7885dd4408
|
@ -44,7 +44,7 @@ from zerver.models import Client, Message, Realm, UserPresence, UserProfile, Cus
|
|||
get_user_profile_by_id, \
|
||||
get_realm_user_dicts, realm_filters_for_realm, get_user,\
|
||||
custom_profile_fields_for_realm, get_realm_domains, \
|
||||
get_default_stream_groups
|
||||
get_default_stream_groups, CustomProfileField
|
||||
from zproject.backends import email_auth_enabled, password_auth_enabled
|
||||
from version import ZULIP_VERSION
|
||||
|
||||
|
@ -124,6 +124,7 @@ def fetch_initial_state_data(user_profile: UserProfile,
|
|||
if want('custom_profile_fields'):
|
||||
fields = custom_profile_fields_for_realm(user_profile.realm.id)
|
||||
state['custom_profile_fields'] = [f.as_dict() for f in fields]
|
||||
state['custom_profile_field_types'] = CustomProfileField.FIELD_TYPE_CHOICES
|
||||
|
||||
if want('attachments'):
|
||||
state['attachments'] = user_attachments(user_profile)
|
||||
|
|
|
@ -51,6 +51,7 @@ class HomeTest(ZulipTestCase):
|
|||
"bot_types",
|
||||
"can_create_streams",
|
||||
"cross_realm_bots",
|
||||
"custom_profile_field_types",
|
||||
"custom_profile_fields",
|
||||
"debug_mode",
|
||||
"default_desktop_notifications",
|
||||
|
|
Loading…
Reference in New Issue