1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 18:22:23 +00:00

Missing await

This commit is contained in:
Yohann D'ANELLO 2021-04-04 16:37:02 +02:00
parent 0a99f10899
commit 833249191c
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -51,7 +51,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias("#annonces:tfjm.org"): if not await Matrix.resolve_room_alias("#annonces:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="annonces", alias="annonces",
@ -61,7 +61,7 @@ class Command(BaseCommand):
preset=RoomPreset.public_chat, preset=RoomPreset.public_chat,
) )
if not Matrix.resolve_room_alias("#bienvenue:tfjm.org"): if not await Matrix.resolve_room_alias("#bienvenue:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="bienvenue", alias="bienvenue",
@ -71,7 +71,7 @@ class Command(BaseCommand):
preset=RoomPreset.public_chat, preset=RoomPreset.public_chat,
) )
if not Matrix.resolve_room_alias("#bot:tfjm.org"): if not await Matrix.resolve_room_alias("#bot:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="bot", alias="bot",
@ -81,7 +81,7 @@ class Command(BaseCommand):
preset=RoomPreset.public_chat, preset=RoomPreset.public_chat,
) )
if not Matrix.resolve_room_alias("#cno:tfjm.org"): if not await Matrix.resolve_room_alias("#cno:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="cno", alias="cno",
@ -91,7 +91,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias("#dev-bot:tfjm.org"): if not await Matrix.resolve_room_alias("#dev-bot:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="dev-bot", alias="dev-bot",
@ -101,7 +101,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias("#faq:tfjm.org"): if not await Matrix.resolve_room_alias("#faq:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="faq", alias="faq",
@ -111,7 +111,7 @@ class Command(BaseCommand):
preset=RoomPreset.public_chat, preset=RoomPreset.public_chat,
) )
if not Matrix.resolve_room_alias("#flood:tfjm.org"): if not await Matrix.resolve_room_alias("#flood:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="flood", alias="flood",
@ -121,7 +121,7 @@ class Command(BaseCommand):
preset=RoomPreset.public_chat, preset=RoomPreset.public_chat,
) )
if not Matrix.resolve_room_alias("#je-cherche-une-equipe:tfjm.org"): if not await Matrix.resolve_room_alias("#je-cherche-une-equipe:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias="je-cherche-une-equipe", alias="je-cherche-une-equipe",
@ -195,7 +195,7 @@ class Command(BaseCommand):
name = tournament.name name = tournament.name
slug = name.lower().replace(" ", "-") slug = name.lower().replace(" ", "-")
if not Matrix.resolve_room_alias(f"#annonces-{slug}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#annonces-{slug}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"annonces-{slug}", alias=f"annonces-{slug}",
@ -205,7 +205,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias(f"#general-{slug}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#general-{slug}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"general-{slug}", alias=f"general-{slug}",
@ -215,7 +215,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias(f"#flood-{slug}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#flood-{slug}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"flood-{slug}", alias=f"flood-{slug}",
@ -225,7 +225,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias(f"#jury-{slug}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#jury-{slug}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"jury-{slug}", alias=f"jury-{slug}",
@ -235,7 +235,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias(f"#orga-{slug}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#orga-{slug}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"orga-{slug}", alias=f"orga-{slug}",
@ -245,7 +245,7 @@ class Command(BaseCommand):
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias(f"#tirage-au-sort-{slug}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#tirage-au-sort-{slug}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"tirage-au-sort-{slug}", alias=f"tirage-au-sort-{slug}",
@ -331,7 +331,7 @@ class Command(BaseCommand):
for i in range(2 if five else 1): for i in range(2 if five else 1):
# Fix for five teams-pools # Fix for five teams-pools
suffix = f"-{chr(ord('A') + i)}" if five else "" suffix = f"-{chr(ord('A') + i)}" if five else ""
if not Matrix.resolve_room_alias(f"#poule-{slug}-{pool.id}{suffix}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#poule-{slug}-{pool.id}{suffix}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"poule-{slug}-{pool.id}{suffix}", alias=f"poule-{slug}-{pool.id}{suffix}",
@ -342,7 +342,7 @@ class Command(BaseCommand):
federate=False, federate=False,
preset=RoomPreset.private_chat, preset=RoomPreset.private_chat,
) )
if not Matrix.resolve_room_alias(f"#poule-{slug}-{pool.id}{suffix}-jurys:tfjm.org"): if not await Matrix.resolve_room_alias(f"#poule-{slug}-{pool.id}{suffix}-jurys:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"poule-{slug}-{pool.id}{suffix}-jurys", alias=f"poule-{slug}-{pool.id}{suffix}-jurys",
@ -357,8 +357,8 @@ class Command(BaseCommand):
await Matrix.set_room_avatar(f"#poule-{slug}-{pool.id}{suffix}:tfjm.org", avatar_uri) await Matrix.set_room_avatar(f"#poule-{slug}-{pool.id}{suffix}:tfjm.org", avatar_uri)
await Matrix.set_room_avatar(f"#poule-{slug}-{pool.id}{suffix}-jurys:tfjm.org", avatar_uri) await Matrix.set_room_avatar(f"#poule-{slug}-{pool.id}{suffix}-jurys:tfjm.org", avatar_uri)
bbb_url = pool.bbb_url bbb_url = pool.bbb_url.strip()
if five: if five and ';' in bbb_url:
bbb_url = bbb_url.split(";")[i].strip() bbb_url = bbb_url.split(";")[i].strip()
url_params = urlencode(dict(url=bbb_url, url_params = urlencode(dict(url=bbb_url,
isAudioConf='false', displayName='$matrix_display_name', isAudioConf='false', displayName='$matrix_display_name',
@ -429,7 +429,7 @@ class Command(BaseCommand):
# Create private channels for teams # Create private channels for teams
for team in Team.objects.all(): for team in Team.objects.all():
self.stdout.write(f"Create private channel for {team}...") self.stdout.write(f"Create private channel for {team}...")
if not Matrix.resolve_room_alias(f"#equipe-{team.trigram.lower()}:tfjm.org"): if not await Matrix.resolve_room_alias(f"#equipe-{team.trigram.lower()}:tfjm.org"):
await Matrix.create_room( await Matrix.create_room(
visibility=RoomVisibility.public, visibility=RoomVisibility.public,
alias=f"equipe-{team.trigram.lower()}", alias=f"equipe-{team.trigram.lower()}",