diff --git a/services/backend/api/v1/task/schemas.py b/services/backend/api/v1/task/schemas.py index 95f2fb4..ec8d80a 100644 --- a/services/backend/api/v1/task/schemas.py +++ b/services/backend/api/v1/task/schemas.py @@ -68,3 +68,4 @@ class TaskStatusSchema(Schema): task_name: str result: int max_points: int + position: int diff --git a/services/backend/api/v1/task/views.py b/services/backend/api/v1/task/views.py index a0ce64c..6cf535d 100644 --- a/services/backend/api/v1/task/views.py +++ b/services/backend/api/v1/task/views.py @@ -210,6 +210,7 @@ def get_competition_results(request, competition_id: UUID): task_name=task.title, result=result, max_points=task.points, + position=task.in_competition_positions )) return status.OK, data diff --git a/services/backend/apps/task/migrations/0004_alter_competitiontaskattachment_bind_at.py b/services/backend/apps/task/migrations/0004_alter_competitiontaskattachment_bind_at.py new file mode 100644 index 0000000..70dea88 --- /dev/null +++ b/services/backend/apps/task/migrations/0004_alter_competitiontaskattachment_bind_at.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.6 on 2025-03-03 23:02 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('task', '0003_alter_competitiontaskattachment_task'), + ] + + operations = [ + migrations.AlterField( + model_name='competitiontaskattachment', + name='bind_at', + field=models.CharField(max_length=255, validators=[django.core.validators.RegexValidator('^(?:[a-zA-Z]:\\\\(?:[^<>:\\"\\/\\\\|?*]*\\\\)*|/(?:[^<>:\\"\\/\\\\|?*]+/?)*)$', message='Введите абсолютный путь до папки')], verbose_name='путь сохранения'), + ), + ] diff --git a/services/backend/apps/task/tasks.py b/services/backend/apps/task/tasks.py index 98d3842..522bf3a 100644 --- a/services/backend/apps/task/tasks.py +++ b/services/backend/apps/task/tasks.py @@ -35,7 +35,7 @@ def analyze_data_task(self, submission_id): "code": base64.b64encode(code).decode("utf-8"), "answer_file_path": submission.task.answer_file_path, "expected_hash": hashlib.sha256( - submission.task.correct_answer_file.read().decode("utf-8") + submission.task.correct_answer_file.read() ).hexdigest(), }, timeout=30, diff --git a/services/backend/scripts/initdb b/services/backend/scripts/initdb index 146732a..7714b7c 100755 --- a/services/backend/scripts/initdb +++ b/services/backend/scripts/initdb @@ -10,4 +10,4 @@ if [ "$DJANGO_CREATE_SUPERUSER" = "True" ]; then python manage.py createsuperuser --noinput --username "$DJANGO_SUPERUSER_USERNAME" --email "$DJANGO_SUPERUSER_EMAIL" || true fi -python manage.py init_achievments \ No newline at end of file +python manage.py init_achievments