Invite people in Matrix rooms at registration

This commit is contained in:
Yohann D'ANELLO 2020-11-16 19:07:10 +01:00
parent d104c2ff1f
commit ce048a30d6
2 changed files with 4 additions and 2 deletions

View File

@ -85,5 +85,7 @@ class Command(BaseCommand):
f"@{admin.matrix_username}:correspondances-maths.fr", 95)
Matrix.set_room_power_level("#faq:correspondances-maths.fr",
f"@{admin.matrix_username}:correspondances-maths.fr", 95)
Matrix.set_room_power_level("#je-cherche-une-equipe:correspondances-maths.fr",
f"@{admin.matrix_username}:correspondances-maths.fr", 95)
Matrix.set_room_power_level("#flood:correspondances-maths.fr",
f"@{admin.matrix_username}:correspondances-maths.fr", 95)

View File

@ -45,9 +45,9 @@ def invite_to_public_rooms(instance: Registration, created: bool, **_):
"""
When a user got registered, automatically invite the Matrix user into public rooms.
"""
if not created:
if created:
Matrix.invite("#annonces:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")
Matrix.invite("#faq:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")
Matrix.invite("#je-cherche-une-equip:correspondances-maths.fr",
Matrix.invite("#je-cherche-une-equipe:correspondances-maths.fr",
f"@{instance.matrix_username}:correspondances-maths.fr")
Matrix.invite("#flood:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")