mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 09:58:06 +00:00
Refactor json_set_avatar and patch_bot_backend to use do_change_avatar_source
(imported from commit eba0ff8a5c4409ac01c710455fe200b28f953b56)
This commit is contained in:
@@ -1340,6 +1340,15 @@ def do_regenerate_api_key(user_profile, log=True):
|
||||
api_key=user_profile.api_key,)),
|
||||
bot_owner_userids(user_profile))
|
||||
|
||||
def do_change_avatar_source(user_profile, avatar_source, log=True):
|
||||
user_profile.avatar_source = avatar_source
|
||||
user_profile.save(update_fields=["avatar_source"])
|
||||
|
||||
if log:
|
||||
log_event({'type': 'user_change_avatar_source',
|
||||
'user': user_profile.email,
|
||||
'avatar_source': avatar_source})
|
||||
|
||||
def _default_stream_permision_check(user_profile, stream):
|
||||
# Any user can have a None default stream
|
||||
if stream is not None:
|
||||
|
||||
Reference in New Issue
Block a user