From 4b89ec19dcc14de9d38bc1321f8aab489bb18e80 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 11 Sep 2024 09:29:04 -0400 Subject: [PATCH 1/2] Fix missing migration on Program.availability --- courses/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/courses/models.py b/courses/models.py index fab9a7d304..6ad87b276b 100644 --- a/courses/models.py +++ b/courses/models.py @@ -159,7 +159,7 @@ class Meta: ) departments = models.ManyToManyField(Department, blank=False) availability = models.CharField( - choices=AVAILABILITY_CHOICES, default=AVAILABILITY_ANYTIME, max_length=255 + choices=[("anytime", "anytime"), ("dated", "dated")], default=AVAILABILITY_ANYTIME, max_length=255 ) @cached_property From a10877fb8f9d576032bff4ceb339eaff25266510 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 11 Sep 2024 10:14:53 -0400 Subject: [PATCH 2/2] making availability types a list --- courses/constants.py | 2 +- courses/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/courses/constants.py b/courses/constants.py index 1f2397c276..76bfbdaebf 100644 --- a/courses/constants.py +++ b/courses/constants.py @@ -34,5 +34,5 @@ AVAILABILITY_ANYTIME = "anytime" AVAILABILITY_DATED = "dated" -AVAILABILITY_TYPES = {AVAILABILITY_ANYTIME, AVAILABILITY_DATED} +AVAILABILITY_TYPES = [AVAILABILITY_ANYTIME, AVAILABILITY_DATED] AVAILABILITY_CHOICES = list(zip(AVAILABILITY_TYPES, AVAILABILITY_TYPES)) diff --git a/courses/models.py b/courses/models.py index 6ad87b276b..fab9a7d304 100644 --- a/courses/models.py +++ b/courses/models.py @@ -159,7 +159,7 @@ class Meta: ) departments = models.ManyToManyField(Department, blank=False) availability = models.CharField( - choices=[("anytime", "anytime"), ("dated", "dated")], default=AVAILABILITY_ANYTIME, max_length=255 + choices=AVAILABILITY_CHOICES, default=AVAILABILITY_ANYTIME, max_length=255 ) @cached_property