stream: Allow new bot to send message if its owner is full member.

We currently not allow new bots to send message in stream with post
policy as 'STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS', but we should
allow them to send messages if their owner is a full member.

This will make it consistent with behavior in stream with post
policy as 'STREAM_POST_POLICY_ADMINS_ONLY' where we allow non admin
bots with owner as admin to send messages.
This commit is contained in:
sahil839 2021-01-08 00:13:12 +05:30 committed by Tim Abbott
parent 3df87d0901
commit 81ae29d461
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ def access_stream_for_send_message(
elif stream.stream_post_policy == Stream.STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS:
if sender.is_bot and (sender.bot_owner is None or sender.bot_owner.is_new_member):
raise JsonableError(_("New members cannot send to this stream."))
elif sender.is_new_member:
elif not sender.is_bot and sender.is_new_member:
raise JsonableError(_("New members cannot send to this stream."))
if stream.is_web_public: