"""Interface for the ows-product-review microservice.""" from flask import g from oto import response from owsrequest import request as requests from sentry_sdk import capture_exception from product.constants import service_name def get_product_review_status(product_id): """Check the status of the product in content review. Args: product_id (int): unique identifier of the product. Returns: Response: Response containing the status details. """ try: result = requests.get( service_name.OWS_PRODUCT_REVIEW, "/status/{}".format(product_id) ) except Exception as exception: capture_exception(exception) g.log.exception(exception.args) return response.create_fatal_response( message="Could not connect to {}.".format(service_name.OWS_PRODUCT_REVIEW) ) return response.Response(result.json(), status=result.status_code)