Add events for bot api_key changes

(imported from commit 44e4e374ee4951c4d984c009ef7af825985fabbf)
This commit is contained in:
Jason Michalski
2014-02-26 14:17:19 -05:00
parent 64ba85aa19
commit c0d104c110
2 changed files with 14 additions and 0 deletions

View File

@@ -1333,6 +1333,13 @@ def do_regenerate_api_key(user_profile, log=True):
log_event({'type': 'user_change_api_key',
'user': user_profile.email})
if user_profile.is_bot:
send_event(dict(type='realm_bot',
op='update',
bot=dict(email=user_profile.email,
api_key=user_profile.api_key,)),
bot_owner_userids(user_profile))
def _default_stream_permision_check(user_profile, stream):
# Any user can have a None default stream
if stream is not None: