Commit 37656d9e by Simon Chen

Fix republish_course_image management command

We should filter out those publisher courses without the image stored in the object
parent f0d14717
......@@ -33,7 +33,11 @@ class Command(BaseCommand):
start_id = options.get('start_id')
end_id = options.get('end_id')
publisher_courses = PublisherCourse.objects.filter(id__range=(start_id, end_id), image__isnull=False)
publisher_courses = PublisherCourse.objects.filter(
id__range=(start_id, end_id),
image__isnull=False
).exclude(image='')
for publisher_course in publisher_courses:
discovery_course = None
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment