mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-05 02:06:52 +00:00
Add a room to search a team
This commit is contained in:
parent
2895fb88db
commit
c11a40e054
@ -45,14 +45,27 @@ class Command(BaseCommand):
|
||||
preset=RoomPreset.public_chat,
|
||||
)
|
||||
|
||||
if not async_to_sync(Matrix.resolve_room_alias)("#je-cherche-une-equipe:correspondances-maths.fr"):
|
||||
Matrix.create_room(
|
||||
visibility=RoomVisibility.public,
|
||||
alias="je-cherche-une-equipe",
|
||||
name="Je cherche une équipe",
|
||||
topic="Le Tinder des Correspondances",
|
||||
federate=False,
|
||||
preset=RoomPreset.public_chat,
|
||||
)
|
||||
|
||||
Matrix.set_room_avatar("#annonces:correspondances-maths.fr", avatar_uri)
|
||||
Matrix.set_room_avatar("#faq:correspondances-maths.fr", avatar_uri)
|
||||
Matrix.set_room_avatar("#je-cherche-une-equipe:correspondances-maths.fr", avatar_uri)
|
||||
|
||||
Matrix.set_room_power_level_event("#annonces:correspondances-maths.fr", "events_default", 50)
|
||||
|
||||
for r in Registration.objects.all():
|
||||
Matrix.invite("#annonces:correspondances-maths.fr", f"@{r.matrix_username}:correspondances-maths.fr")
|
||||
Matrix.invite("#faq:correspondances-maths.fr", f"@{r.matrix_username}:correspondances-maths.fr")
|
||||
Matrix.invite("#je-cherche-une-equipe:correspondances-maths.fr",
|
||||
f"@{r.matrix_username}:correspondances-maths.fr")
|
||||
|
||||
for admin in AdminRegistration.objects.all():
|
||||
Matrix.set_room_power_level("#annonces:correspondances-maths.fr",
|
||||
|
@ -48,3 +48,5 @@ def invite_to_public_rooms(instance: Registration, **_):
|
||||
if not instance.pk:
|
||||
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",
|
||||
f"@{instance.matrix_username}:correspondances-maths.fr")
|
||||
|
Loading…
Reference in New Issue
Block a user