Revert add_admins property logic since it differs from the rest

This commit is contained in:
Lonami Exo 2020-10-07 09:44:17 +02:00
parent d2756cf68f
commit 5722ba8306

View File

@ -79,6 +79,17 @@ class ParticipantPermissions:
"""
return isinstance(self.participant, types.ChannelParticipantBanned)
@property
def add_admins(self):
"""
Whether the administrator can add new administrators with the same or
less permissions than them.
"""
if not self.is_admin or (self.is_chat and not self.is_creator):
return False
return self.participant.admin_rights.add_admins
ban_users = property(**_admin_prop('ban_users', """
Whether the administrator can ban other users or not.
"""))
@ -87,11 +98,6 @@ class ParticipantPermissions:
Whether the administrator can pin messages or not.
"""))
add_admins = property(**_admin_prop('add_admins', """
Whether the administrator can add new administrators with the same or
less permissions than them.
"""))
invite_users = property(**_admin_prop('invite_users', """
Whether the administrator can add new users to the chat.
"""))