events: Add date_joined to user_dict.

This commit is contained in:
Vishnu Ks 2018-05-15 11:00:52 +00:00 committed by Tim Abbott
parent 47b0a0d843
commit 372e9740ac
4 changed files with 6 additions and 1 deletions

View File

@ -431,6 +431,7 @@ def notify_created_user(user_profile: UserProfile) -> None:
full_name=user_profile.full_name,
avatar_url=avatar_url(user_profile),
timezone=user_profile.timezone,
date_joined=user_profile.date_joined.isoformat(),
is_bot=user_profile.is_bot))
send_event(event, active_user_ids(user_profile.realm_id))

View File

@ -321,7 +321,9 @@ def user_profile_by_api_key_cache_key(api_key: str) -> str:
realm_user_dict_fields = [
'id', 'full_name', 'short_name', 'email',
'avatar_source', 'avatar_version', 'is_active',
'is_realm_admin', 'is_bot', 'realm_id', 'timezone'] # type: List[str]
'is_realm_admin', 'is_bot', 'realm_id', 'timezone',
'date_joined'
] # type: List[str]
def realm_user_dicts_cache_key(realm_id: int) -> str:
return "realm_user_dicts:%s" % (realm_id,)

View File

@ -82,6 +82,7 @@ def get_raw_user_data(realm_id: int, client_gravatar: bool) -> Dict[int, Dict[st
full_name=row['full_name'],
timezone=row['timezone'],
is_active = row['is_active'],
date_joined = row['date_joined'].isoformat(),
)
if not is_bot:
result['profile_data'] = profiles_by_user_id.get(row['id'], {})

View File

@ -1061,6 +1061,7 @@ class EventsRegisterTest(ZulipTestCase):
('is_admin', check_bool),
('is_bot', check_bool),
('timezone', check_string),
('date_joined', check_string),
])),
])