From ce048a30d6fcfcbcbc97660129503908bb37eff3 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 16 Nov 2020 19:07:10 +0100 Subject: [PATCH] Invite people in Matrix rooms at registration --- apps/participation/management/commands/fix_matrix_channels.py | 2 ++ apps/registration/signals.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/participation/management/commands/fix_matrix_channels.py b/apps/participation/management/commands/fix_matrix_channels.py index 7ce878c..a1981d6 100644 --- a/apps/participation/management/commands/fix_matrix_channels.py +++ b/apps/participation/management/commands/fix_matrix_channels.py @@ -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) diff --git a/apps/registration/signals.py b/apps/registration/signals.py index 0a6edec..d8f0a95 100644 --- a/apps/registration/signals.py +++ b/apps/registration/signals.py @@ -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")