Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dc6dca4
init branch + UI for competitions groups
IdirLISN Jan 27, 2026
10af8d0
groups and queues, creation, update, delete ok
IdirLISN Feb 3, 2026
62f583b
tests sur site worker
IdirLISN Feb 3, 2026
21f8209
feature OK, user sub sent to queue from group
IdirLISN Feb 4, 2026
891c3f2
only competition participant can be added to a competition group
IdirLISN Feb 5, 2026
e7d3a17
removing exention to LICENSE file
IdirLISN Feb 5, 2026
fb4d5eb
multiple routing queues OK
IdirLISN Feb 10, 2026
f266e23
revert
IdirLISN Feb 10, 2026
c47bcec
Edit participant ui bug fixed
IdirLISN Feb 11, 2026
fa64a6a
Edit participant ui bug fixed
IdirLISN Feb 11, 2026
0beca33
added logic to create group in competition with yaml
IdirLISN Feb 11, 2026
8b4fcdb
Revert "revert"
Feb 12, 2026
660243b
fix deprecated method (ajax)
IdirLISN Feb 12, 2026
0fab1df
scoring route ok
IdirLISN Feb 19, 2026
b5ca691
restore tests/*
IdirLISN Feb 19, 2026
167f9cd
feature test
IdirLISN Feb 26, 2026
61aa010
rebase branch and fix playwright tests
Feb 26, 2026
b7e4e8d
commit avant pull et merge
IdirLISN Feb 26, 2026
932ef1a
feature ok, needs to be tested
IdirLISN Feb 26, 2026
eb4c9f9
debug serveur status routing of scoring
IdirLISN Feb 26, 2026
9a41be2
improved UI for competitions groups
IdirLISN Feb 26, 2026
36f8cb1
cascade delete on competition groups
IdirLISN Feb 26, 2026
3ee12fb
improved ui for group creation
IdirLISN Feb 26, 2026
f8194b5
hard delete group, feature need to be tested
IdirLISN Mar 3, 2026
483103d
rebase and fix some bad merges
Mar 17, 2026
405ae8f
fix conflict
IdirLISN Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,8 @@ Update the worker:
docker compose down
docker compose pull
docker compose up -d
<<<<<<< HEAD
```
=======
```
>>>>>>> ef6beaa1 (Revert "revert")
2 changes: 1 addition & 1 deletion documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ nav:
- Contribute/index.md
- Contribute/contributing.md
- FAQ: Project_CodaBench_FAQ.md
- Contact Us: contact-us.md
- Contact Us: contact-us.md
594 changes: 500 additions & 94 deletions src/apps/api/views/competitions.py

Large diffs are not rendered by default.

45 changes: 44 additions & 1 deletion src/apps/competitions/admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from django import forms
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
import json
import csv
from django.http import HttpResponse
from profiles.models import User
from profiles.models import CustomGroup, User
from . import models
from django.contrib.auth.models import Group
from django.contrib.admin.widgets import FilteredSelectMultiple


# General class used to make custom filter
Expand Down Expand Up @@ -348,6 +351,46 @@ class PhaseExpansion(admin.ModelAdmin):
]


class CustomGroupAdminForm(forms.ModelForm):
users = forms.ModelMultipleChoiceField(
queryset=User.objects.all(),
required=False,
widget=FilteredSelectMultiple("Users", is_stacked=False),
help_text="Add/Remove users for this group."
)

class Meta:
model = CustomGroup
fields = ('name', 'permissions', 'queue', 'users')

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.instance and self.instance.pk:
self.fields['users'].initial = self.instance.user_set.all()


admin.site.unregister(Group)
@admin.register(CustomGroup)
class CustomGroupAdmin(admin.ModelAdmin):
form = CustomGroupAdminForm
list_display = ('name', 'queue')
search_fields = ('name',)
filter_horizontal = ('permissions',)
fieldsets = (
(None, {'fields': ('name',)}),
('Permissions', {'fields': ('permissions',)}),
('Utilisateurs', {'fields': ('users',)}),
('Options', {'fields': ('queue',)}),
)

def save_model(self, request, obj, form, change):
super().save_model(request, obj, form, change)

def save_related(self, request, form, formsets, change):
super().save_related(request, form, formsets, change)
form.instance.user_set.set(form.cleaned_data['users'])


admin.site.register(models.Competition, CompetitionExpansion)
admin.site.register(
models.CompetitionCreationTaskStatus, CompetitionCreationTaskStatusExpansion
Expand Down
11 changes: 10 additions & 1 deletion src/apps/competitions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from celery_config import app, app_for_vhost
from leaderboards.models import SubmissionScore
from profiles.models import User, Organization
from profiles.models import CustomGroup, User, Organization
from utils.data import PathWrapper
from utils.storage import BundleStorage
from PIL import Image
Expand Down Expand Up @@ -55,6 +55,15 @@ class Competition(models.Model):
make_programs_available = models.BooleanField(default=False)
make_input_data_available = models.BooleanField(default=False)

participant_groups = models.ManyToManyField(
CustomGroup,
blank=True,
related_name='competitions',
verbose_name="group of participants",
help_text="Competition owner being able to create groups of users."
)


queue = models.ForeignKey('queues.Queue', on_delete=models.SET_NULL, null=True, blank=True,
related_name='competitions')

Expand Down
Loading