mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 14:27:10 +00:00
Merge branch 'master' of https://gitlab.prodcontest.ru/team-15/project
This commit is contained in:
@@ -35,6 +35,7 @@ router = Router(tags=["competition"])
|
|||||||
)
|
)
|
||||||
def start_competition(request, competition_id: UUID) -> PingOut:
|
def start_competition(request, competition_id: UUID) -> PingOut:
|
||||||
competition = get_object_or_404(Competition, pk=competition_id)
|
competition = get_object_or_404(Competition, pk=competition_id)
|
||||||
|
competition.participants.add(request.auth)
|
||||||
state_obj, _ = State.objects.update_or_create(
|
state_obj, _ = State.objects.update_or_create(
|
||||||
user=request.auth, competition=competition, state="started"
|
user=request.auth, competition=competition, state="started"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ class CompetitionTask(BaseModel):
|
|||||||
def answer_file_upload_to(instance, filename) -> str:
|
def answer_file_upload_to(instance, filename) -> str:
|
||||||
return f"tasks/{instance.id}/answer/{uuid4()}/{filename}"
|
return f"tasks/{instance.id}/answer/{uuid4()}/{filename}"
|
||||||
|
|
||||||
in_competition_position = models.PositiveSmallIntegerField(
|
in_competition_position = models.PositiveSmallIntegerField()
|
||||||
null=True, blank=True
|
|
||||||
)
|
|
||||||
competition = models.ForeignKey(Competition, on_delete=models.CASCADE)
|
competition = models.ForeignKey(Competition, on_delete=models.CASCADE)
|
||||||
title = models.CharField(verbose_name="заголовок", max_length=50)
|
title = models.CharField(verbose_name="заголовок", max_length=50)
|
||||||
description = MartorField(verbose_name="описание")
|
description = MartorField(verbose_name="описание")
|
||||||
|
|||||||
Reference in New Issue
Block a user