mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
events: Only send bot_type for bots and thus remove the for_api param.
This commit is contained in:
committed by
Tim Abbott
parent
fa6bd42f4c
commit
c1370547d5
@@ -75,8 +75,7 @@ def get_custom_profile_field_values(realm_id: int) -> Dict[int, Dict[str, Any]]:
|
||||
return profiles_by_user_id
|
||||
|
||||
|
||||
def get_raw_user_data(realm: Realm, user_profile: UserProfile,
|
||||
client_gravatar: bool, for_api: bool=False,
|
||||
def get_raw_user_data(realm: Realm, user_profile: UserProfile, client_gravatar: bool,
|
||||
include_custom_profile_fields: bool=True) -> Dict[int, Dict[str, str]]:
|
||||
user_dicts = get_realm_user_dicts(realm.id)
|
||||
|
||||
@@ -115,12 +114,8 @@ def get_raw_user_data(realm: Realm, user_profile: UserProfile,
|
||||
user_profile.is_realm_admin):
|
||||
result['delivery_email'] = row['delivery_email']
|
||||
|
||||
if for_api:
|
||||
# The API currently has a quirk that it expects to include
|
||||
# a bot_type field even for human users; this field is
|
||||
# invalid so we plan to eventually remove this.
|
||||
result['bot_type'] = row['bot_type']
|
||||
if is_bot:
|
||||
result["bot_type"] = row["bot_type"]
|
||||
if row['email'] in settings.CROSS_REALM_BOT_EMAILS:
|
||||
result['is_cross_realm_bot'] = True
|
||||
elif row['bot_owner_id'] is not None:
|
||||
|
||||
Reference in New Issue
Block a user