fix add_admins property of custom.ParticipantPermissions #3131

This commit is contained in:
aszubarev 2021-08-14 18:51:47 +03:00
parent e546ae2f85
commit 0d21b1ccb3

View File

@ -92,9 +92,12 @@ class ParticipantPermissions:
Whether the administrator can add new administrators with the same or Whether the administrator can add new administrators with the same or
less permissions than them. less permissions than them.
""" """
if not self.is_admin or (self.is_chat and not self.is_creator): if not self.is_admin:
return False return False
if self.is_chat:
return self.is_creator
return self.participant.admin_rights.add_admins return self.participant.admin_rights.add_admins
ban_users = property(**_admin_prop('ban_users', """ ban_users = property(**_admin_prop('ban_users', """