We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7642af8 commit a13acc1Copy full SHA for a13acc1
cms/api.py
@@ -267,6 +267,9 @@ def ensure_instructors_index() -> cms_models.InstructorIndexPage:
267
268
def get_wagtail_img_src(image_obj) -> str:
269
"""Returns the image source URL for a Wagtail Image object"""
270
+ if not image_obj or not image_obj.file:
271
+ return ""
272
+
273
root_rel = urljoin(settings.MEDIA_URL, image_obj.file.name)
274
abs_url = urljoin(settings.SITE_BASE_URL, root_rel)
275
return (
0 commit comments