Browse Source

feat(course): update thumbnail field to be required

- Altered the thumbnail field in the Course model to remove null and blank options, making it mandatory.
- Added a migration to reflect this change in the database schema.
master
mortezaei 8 months ago
parent
commit
dedbccac05
  1. 19
      apps/course/migrations/0007_alter_course_thumbnail.py
  2. 2
      apps/course/models/course.py

19
apps/course/migrations/0007_alter_course_thumbnail.py

@ -0,0 +1,19 @@
# Generated by Django 3.2.4 on 2025-09-16 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0006_participant_is_active'),
]
operations = [
migrations.AlterField(
model_name='course',
name='thumbnail',
field=models.ImageField(default='1', upload_to='courses/thumbnails/', verbose_name='Thumbnail'),
preserve_default=False,
),
]

2
apps/course/models/course.py

@ -69,7 +69,7 @@ class Course(models.Model):
related_name="courses" related_name="courses"
) )
thumbnail = models.ImageField(upload_to="courses/thumbnails/", null=True, blank=True, verbose_name=_('Thumbnail'))
thumbnail = models.ImageField(upload_to="courses/thumbnails/", verbose_name=_('Thumbnail'))
video_type = models.CharField( video_type = models.CharField(
max_length=20, max_length=20,
choices=VedioTypeChoices.choices, choices=VedioTypeChoices.choices,

Loading…
Cancel
Save