From 47fc18bbc9daf4a0f26856e197eec8e96d29972d Mon Sep 17 00:00:00 2001 From: Nikhil Kothari Date: Fri, 11 Oct 2024 18:33:44 +0530 Subject: [PATCH] fix: create channel member for open channels --- .../doctype/raven_channel/raven_channel.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/raven/raven_channel_management/doctype/raven_channel/raven_channel.py b/raven/raven_channel_management/doctype/raven_channel/raven_channel.py index e18ab3439..050f99acd 100644 --- a/raven/raven_channel_management/doctype/raven_channel/raven_channel.py +++ b/raven/raven_channel_management/doctype/raven_channel/raven_channel.py @@ -92,16 +92,14 @@ def after_insert(self): unique_raven_users = list(set(raven_users)) self.add_members(unique_raven_users) else: - # If this was not created by a bot, add the current user as a member - if self.type == "Private" or self.type == "Public": - frappe.get_doc( - { - "doctype": "Raven Channel Member", - "channel_id": self.name, - "user_id": frappe.session.user, - "is_admin": 1, - } - ).insert() + frappe.get_doc( + { + "doctype": "Raven Channel Member", + "channel_id": self.name, + "user_id": frappe.session.user, + "is_admin": 1, + } + ).insert() def validate(self): # If the user trying to modify the channel is not the owner or channel member, then don't allow