From 6894bfebd0afcc83a0b16db62fdecc4ba9716569 Mon Sep 17 00:00:00 2001 From: Hina Khadim Date: Thu, 12 Oct 2023 13:42:47 +0500 Subject: [PATCH] fix: update course and course_run card_image_url length to 500 --- .../migrations/0322_auto_20231012_0821.py | 33 +++++++++++++++++++ .../apps/course_metadata/models.py | 4 +-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 course_discovery/apps/course_metadata/migrations/0322_auto_20231012_0821.py diff --git a/course_discovery/apps/course_metadata/migrations/0322_auto_20231012_0821.py b/course_discovery/apps/course_metadata/migrations/0322_auto_20231012_0821.py new file mode 100644 index 0000000000..d91e382a43 --- /dev/null +++ b/course_discovery/apps/course_metadata/migrations/0322_auto_20231012_0821.py @@ -0,0 +1,33 @@ +# Generated by Django 3.2.20 on 2023-10-12 08:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('course_metadata', '0321_add_verified_only_course_type'), + ] + + operations = [ + migrations.AlterField( + model_name='course', + name='card_image_url', + field=models.URLField(blank=True, max_length=500, null=True), + ), + migrations.AlterField( + model_name='courserun', + name='card_image_url', + field=models.URLField(blank=True, max_length=500, null=True), + ), + migrations.AlterField( + model_name='historicalcourse', + name='card_image_url', + field=models.URLField(blank=True, max_length=500, null=True), + ), + migrations.AlterField( + model_name='historicalcourserun', + name='card_image_url', + field=models.URLField(blank=True, max_length=500, null=True), + ), + ] diff --git a/course_discovery/apps/course_metadata/models.py b/course_discovery/apps/course_metadata/models.py index 64efd2070c..842c881149 100644 --- a/course_discovery/apps/course_metadata/models.py +++ b/course_discovery/apps/course_metadata/models.py @@ -1195,7 +1195,7 @@ class Course(DraftModelMixin, PkSearchableMixin, CachedMixin, TimeStampedModel): outcome = NullHtmlField() prerequisites_raw = NullHtmlField() syllabus_raw = NullHtmlField() - card_image_url = models.URLField(null=True, blank=True) + card_image_url = models.URLField(null=True, blank=True, max_length=500) image = StdImageField( upload_to=UploadToFieldNamePath(populate_from='uuid', path='media/course/image'), blank=True, @@ -1860,7 +1860,7 @@ class CourseRun(DraftModelMixin, CachedMixin, TimeStampedModel): ) # TODO Ditch this, and fallback to the course - card_image_url = models.URLField(null=True, blank=True) + card_image_url = models.URLField(null=True, blank=True, max_length=500) video = models.ForeignKey(Video, models.CASCADE, default=None, null=True, blank=True) video_translation_languages = models.ManyToManyField( LanguageTag, blank=True, related_name='+')