mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-06 11:33:00 +00:00
Fix auto-invitation in Matrix public rooms
This commit is contained in:
parent
c80355f2bc
commit
be17d11581
@ -15,3 +15,6 @@ class RegistrationConfig(AppConfig):
|
|||||||
pre_save.connect(send_email_link, "auth.User")
|
pre_save.connect(send_email_link, "auth.User")
|
||||||
post_save.connect(create_admin_registration, "auth.User")
|
post_save.connect(create_admin_registration, "auth.User")
|
||||||
post_save.connect(invite_to_public_rooms, "registration.Registration")
|
post_save.connect(invite_to_public_rooms, "registration.Registration")
|
||||||
|
post_save.connect(invite_to_public_rooms, "registration.StudentRegistration")
|
||||||
|
post_save.connect(invite_to_public_rooms, "registration.CoachRegistration")
|
||||||
|
post_save.connect(invite_to_public_rooms, "registration.AdminRegistration")
|
||||||
|
@ -41,11 +41,11 @@ def create_admin_registration(instance, **_):
|
|||||||
AdminRegistration.objects.get_or_create(user=instance)
|
AdminRegistration.objects.get_or_create(user=instance)
|
||||||
|
|
||||||
|
|
||||||
def invite_to_public_rooms(instance: Registration, **_):
|
def invite_to_public_rooms(instance: Registration, created: bool, **_):
|
||||||
"""
|
"""
|
||||||
When a user got registered, automatically invite the Matrix user into public rooms.
|
When a user got registered, automatically invite the Matrix user into public rooms.
|
||||||
"""
|
"""
|
||||||
if not instance.pk:
|
if not created:
|
||||||
Matrix.invite("#annonces:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")
|
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("#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-equip:correspondances-maths.fr",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user