def get(self):
"""
Retrieve licensors
"""
source_id_type = self.get_argument('source_id_type', None)
source_id = self.get_argument('source_id', None)
if not source_id_type or not source_id:
raise HTTPError(400, 'Must have "source_id_type" and "source_id" parameters')
try:
translated_id = common.translate_id_pair(
{'source_id_type': source_id_type, 'source_id': source_id})
except ValueError:
raise HTTPError(400, '{} is an invalid hub key'.format(source_id))
try:
result = yield licensors.get_asset_licensors(
translated_id['source_id_type'],
translated_id['source_id']
)
self.finish(result)
except httpclient.HTTPError as exc:
body = json.loads(exc.response.body)
raise HTTPError(exc.response.code, body)
评论列表
文章目录