Skip to content

Commit 19ceb15

Browse files
committed
Allow Cohort with no students
1 parent 56a4db6 commit 19ceb15

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.2.4 on 2025-07-17 14:19
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('main', '0129_cohort_students_alter_cohort_instructors'),
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='cohort',
17+
name='students',
18+
field=models.ManyToManyField(blank=True, related_name='courses_enrolled', to=settings.AUTH_USER_MODEL),
19+
),
20+
]

econplayground/main/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class Cohort(models.Model):
4040
deployment_id = models.CharField(max_length=256, blank=True, default='')
4141

4242
instructors = models.ManyToManyField(User, related_name='courses_taught')
43-
students = models.ManyToManyField(User, related_name='courses_enrolled')
43+
students = models.ManyToManyField(User, related_name='courses_enrolled',
44+
blank=True)
4445

4546
is_sample = models.BooleanField(null=True, blank=True, unique=True)
4647
is_archived = models.BooleanField(default=False)

0 commit comments

Comments
 (0)