1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-08-07 02:39:44 +02:00

Upload solution is working

This commit is contained in:
Yohann D'ANELLO
2021-01-12 17:24:46 +01:00
parent 09e5a72470
commit 2ca0444053
7 changed files with 109 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ from django.core.exceptions import ValidationError
from django.utils import formats
from django.utils.translation import gettext_lazy as _
from .models import Participation, Team, Tournament
from .models import Participation, Team, Tournament, Solution
class TeamForm(forms.ModelForm):
@@ -112,3 +112,14 @@ class TournamentForm(forms.ModelForm):
class Meta:
model = Tournament
fields = '__all__'
class SolutionForm(forms.ModelForm):
def save(self, commit=True):
"""
Don't save a solution with this way. Use a view instead
"""
class Meta:
model = Solution
fields = ('problem', 'file',)