From c3f3d638aa4cf0303a59751136d56ba86f8ccf83 Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Fri, 18 Mar 2022 18:05:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F(core)=20add=20is=5Fgradab?= =?UTF-8?q?le=20boolean=20field=20to=20CourseRun=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This boolean field allow a course leader to mark its session as gradable. Gradable course runs can be used to generate a certificate. --- .../migrations/0002_courserun_is_gradable.py | 18 ++++++++++++++++++ src/backend/joanie/core/models/courses.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 src/backend/joanie/core/migrations/0002_courserun_is_gradable.py diff --git a/src/backend/joanie/core/migrations/0002_courserun_is_gradable.py b/src/backend/joanie/core/migrations/0002_courserun_is_gradable.py new file mode 100644 index 0000000000..37edb006a8 --- /dev/null +++ b/src/backend/joanie/core/migrations/0002_courserun_is_gradable.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.3 on 2022-03-18 16:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0001_initial"), + ] + + operations = [ + migrations.AddField( + model_name="courserun", + name="is_gradable", + field=models.BooleanField(default=False, verbose_name="is gradable"), + ), + ] diff --git a/src/backend/joanie/core/models/courses.py b/src/backend/joanie/core/models/courses.py index 5682c10699..f3778b6731 100644 --- a/src/backend/joanie/core/models/courses.py +++ b/src/backend/joanie/core/models/courses.py @@ -267,6 +267,7 @@ class CourseRun(parler_models.TranslatableModel): choices=lazy(lambda: ALL_LANGUAGES, tuple)(), help_text=_("The list of languages in which the course content is available."), ) + is_gradable = models.BooleanField(_("is gradable"), default=False) class Meta: db_table = "joanie_course_run"