def bg_image(value, message='Invalid background image path'):
  if not value:
    return value
  if not BG_IMAGE_COMPILED.match(value):
    raise exception.ValidationError(message)
  return value
bg_image should always be in the form returned from api.background_upload.
dataset/ETHPy150Open CollabQ/CollabQ/common/clean.py/bg_image