def course_image_url(course, image_key='course_image'):
 if course.static_asset_path:
  url = ('/static/' + (course.static_asset_path or getattr(course, 'data_dir', '')))
  if (hasattr(course, image_key) and (getattr(course, image_key) != course.fields[image_key].default)):
   url += ('/' + getattr(course, image_key))
  else:
   url += (('/images/' + image_key) + '.jpg')
 elif (not getattr(course, image_key)):
  url = (settings.STATIC_URL + settings.DEFAULT_COURSE_ABOUT_IMAGE_URL)
 else:
  loc = StaticContent.compute_location(course.id, getattr(course, image_key))
  url = StaticContent.serialize_asset_key_with_slash(loc)
 return url

def course_image_url ( course , image_key = 'course_image' ) : if course . static_asset_path : url = ( '/static/' + ( course . static_asset_path or getattr ( course , 'data_dir' , '' ) ) ) if ( hasattr ( course , image_key ) and ( getattr ( course , image_key ) != course . fields [ image_key ] . default ) ) : url += ( '/' + getattr ( course , image_key ) ) else : url += ( ( '/images/' + image_key ) + '.jpg' ) elif ( not getattr ( course , image_key ) ) : url = ( settings . STATIC_URL + settings . DEFAULT_COURSE_ABOUT_IMAGE_URL ) else : loc = StaticContent . compute_location ( course . id , getattr ( course , image_key ) ) url = StaticContent . serialize_asset_key_with_slash ( loc ) return url
try to look up the image url for the course .