def card_ocr_text(card_id): """ Returns the OCR text of a card if it is an image card. """ ocr = OCR.get_ocr_by_card_id(card_id) if not ocr: return error(Error.NO_OCR_TEXT) return ok({ "ocr": { "card_id": ocr.card_id, "text": ocr.text } })