mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 05:18:26 +02:00
Store the BBB link in the Pool model
This commit is contained in:
@ -143,7 +143,7 @@ class SolutionForm(forms.ModelForm):
|
||||
class PoolForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Pool
|
||||
fields = ('tournament', 'round', 'juries',)
|
||||
fields = ('tournament', 'round', 'bbb_code', 'juries',)
|
||||
widgets = {
|
||||
"juries": forms.CheckboxSelectMultiple,
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ class Command(BaseCommand):
|
||||
Matrix.set_room_avatar(f"#poule-{slug}-{pool.id}:tfjm.org", avatar_uri)
|
||||
Matrix.set_room_avatar(f"#poule-{slug}-{pool.id}-jurys:tfjm.org", avatar_uri)
|
||||
|
||||
url_params = urlencode(dict(url="https://visio.animath.live/b/XXX-XXX-XXX",
|
||||
url_params = urlencode(dict(url=f"https://visio.animath.live/b/{pool.bbb_code}",
|
||||
isAudioConf='false', displayName='$matrix_display_name',
|
||||
avatarUrl='$matrix_avatar_url', userId='$matrix_user_id')) \
|
||||
.replace("%24", "$")
|
||||
|
19
apps/participation/migrations/0012_pool_bbb_code.py
Normal file
19
apps/participation/migrations/0012_pool_bbb_code.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 3.0.11 on 2021-01-21 16:47
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('participation', '0011_note'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='pool',
|
||||
name='bbb_code',
|
||||
field=models.CharField(blank=True, default='', help_text='The code of the form xxx-xxx-xxx at the end of the BBB link.', max_length=11, validators=[django.core.validators.RegexValidator('[a-z]{3}-[a-z]{3}-[a-z]{3}')], verbose_name='BigBlueButton code'),
|
||||
),
|
||||
]
|
@ -344,6 +344,15 @@ class Pool(models.Model):
|
||||
verbose_name=_("juries"),
|
||||
)
|
||||
|
||||
bbb_code = models.CharField(
|
||||
max_length=11,
|
||||
blank=True,
|
||||
default="",
|
||||
verbose_name=_("BigBlueButton code"),
|
||||
help_text=_("The code of the form xxx-xxx-xxx at the end of the BBB link."),
|
||||
validators=[RegexValidator("[a-z]{3}-[a-z]{3}-[a-z]{3}")],
|
||||
)
|
||||
|
||||
@property
|
||||
def solutions(self):
|
||||
return Solution.objects.filter(participation__in=self.participations, final_solution=self.tournament.final)
|
||||
|
Reference in New Issue
Block a user