Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
francisvaut committed Mar 4, 2024
2 parents 5656ce3 + 8047e7c commit 10af317
Show file tree
Hide file tree
Showing 62 changed files with 1,412 additions and 1,142 deletions.
Binary file added backend/.coverage
Binary file not shown.
4 changes: 2 additions & 2 deletions backend/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


class ApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'api'
default_auto_field = "django.db.models.BigAutoField"
name = "api"

def ready(self):
from authentication.signals import user_created
Expand Down
297 changes: 236 additions & 61 deletions backend/api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,125 +7,300 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
('authentication', '0001_initial'),
("authentication", "0001_initial"),
]

operations = [
migrations.CreateModel(
name='Admin',
name="Admin",
fields=[
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
(
"user_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to=settings.AUTH_USER_MODEL,
),
),
],
options={
'abstract': False,
"abstract": False,
},
bases=('authentication.user',),
bases=("authentication.user",),
),
migrations.CreateModel(
name='FileExtension',
name="FileExtension",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('extension', models.CharField(max_length=10, unique=True)),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("extension", models.CharField(max_length=10, unique=True)),
],
),
migrations.CreateModel(
name='Course',
name="Course",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('academic_startyear', models.IntegerField()),
('description', models.TextField(blank=True, null=True)),
('parent_course', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='child_course', to='api.course')),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
("academic_startyear", models.IntegerField()),
("description", models.TextField(blank=True, null=True)),
(
"parent_course",
models.OneToOneField(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="child_course",
to="api.course",
),
),
],
),
migrations.CreateModel(
name='Assistant',
name="Assistant",
fields=[
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
('courses', models.ManyToManyField(blank=True, related_name='assistants', to='api.course')),
(
"user_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to=settings.AUTH_USER_MODEL,
),
),
(
"courses",
models.ManyToManyField(
blank=True, related_name="assistants", to="api.course"
),
),
],
options={
'abstract': False,
"abstract": False,
},
bases=('authentication.user',),
bases=("authentication.user",),
),
migrations.CreateModel(
name='Checks',
name="Checks",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dockerfile', models.FileField(blank=True, null=True, upload_to='')),
('allowed_file_extensions', models.ManyToManyField(blank=True, related_name='checks_allowed', to='api.fileextension')),
('forbidden_file_extensions', models.ManyToManyField(blank=True, related_name='checks_forbidden', to='api.fileextension')),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("dockerfile", models.FileField(blank=True, null=True, upload_to="")),
(
"allowed_file_extensions",
models.ManyToManyField(
blank=True,
related_name="checks_allowed",
to="api.fileextension",
),
),
(
"forbidden_file_extensions",
models.ManyToManyField(
blank=True,
related_name="checks_forbidden",
to="api.fileextension",
),
),
],
),
migrations.CreateModel(
name='Project',
name="Project",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('description', models.TextField(blank=True, null=True)),
('visible', models.BooleanField(default=True)),
('archived', models.BooleanField(default=False)),
('start_date', models.DateTimeField(blank=True, default=datetime.datetime.now)),
('deadline', models.DateTimeField()),
('checks', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.checks')),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='api.course')),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
("description", models.TextField(blank=True, null=True)),
("visible", models.BooleanField(default=True)),
("archived", models.BooleanField(default=False)),
(
"start_date",
models.DateTimeField(blank=True, default=datetime.datetime.now),
),
("deadline", models.DateTimeField()),
(
"checks",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="api.checks",
),
),
(
"course",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="projects",
to="api.course",
),
),
],
),
migrations.CreateModel(
name='Student',
name="Student",
fields=[
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
('student_id', models.CharField(max_length=8, null=True, unique=True)),
('courses', models.ManyToManyField(blank=True, related_name='students', to='api.course')),
(
"user_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to=settings.AUTH_USER_MODEL,
),
),
("student_id", models.CharField(max_length=8, null=True, unique=True)),
(
"courses",
models.ManyToManyField(
blank=True, related_name="students", to="api.course"
),
),
],
options={
'abstract': False,
"abstract": False,
},
bases=('authentication.user',),
bases=("authentication.user",),
),
migrations.CreateModel(
name='Group',
name="Group",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('score', models.FloatField(blank=True, null=True)),
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='groups', to='api.project')),
('students', models.ManyToManyField(related_name='groups', to='api.student')),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("score", models.FloatField(blank=True, null=True)),
(
"project",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="groups",
to="api.project",
),
),
(
"students",
models.ManyToManyField(related_name="groups", to="api.student"),
),
],
),
migrations.CreateModel(
name='Submission',
name="Submission",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('submission_number', models.PositiveIntegerField()),
('submission_time', models.DateTimeField(auto_now_add=True)),
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='api.group')),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("submission_number", models.PositiveIntegerField()),
("submission_time", models.DateTimeField(auto_now_add=True)),
(
"group",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="submissions",
to="api.group",
),
),
],
options={
'unique_together': {('group', 'submission_number')},
"unique_together": {("group", "submission_number")},
},
),
migrations.CreateModel(
name='SubmissionFile',
name="SubmissionFile",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(upload_to='')),
('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='api.submission')),
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("file", models.FileField(upload_to="")),
(
"submission",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="files",
to="api.submission",
),
),
],
),
migrations.CreateModel(
name='Teacher',
name="Teacher",
fields=[
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
('courses', models.ManyToManyField(blank=True, related_name='teachers', to='api.course')),
(
"user_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to=settings.AUTH_USER_MODEL,
),
),
(
"courses",
models.ManyToManyField(
blank=True, related_name="teachers", to="api.course"
),
),
],
options={
'abstract': False,
"abstract": False,
},
bases=('authentication.user',),
bases=("authentication.user",),
),
]
4 changes: 2 additions & 2 deletions backend/api/models/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class Assistant(User):
courses = models.ManyToManyField(
Course,
# Allows us to access the assistants from the course
related_name='assistants',
blank=True
related_name="assistants",
blank=True,
)
Loading

0 comments on commit 10af317

Please sign in to comment.