def view_publisher_tasks(request): u"""Show the publication tasks home page.""" try: data = get_request_data(request, accepted_keys=api_core.db_find_keys, qs_only_first_value=True, optional=True) data.setdefault(u'skip', 50) # ask for the last 50 media assets if skip is not provided data.setdefault(u'spec', {u'status': Media.READY}) # filter the media assets that cannot be published # FIXME add more filters medias = remove_underscores(api_core.get_medias(**data)) queues = remove_underscores(api_core.get_publisher_queues()) return {u'medias': medias, u'queues': queues} except Exception as e: logging.exception(e) return {u'errors': [unicode(e)]}
def api_publisher_queue(auth_user=None, api_core=None, request=None): u"""Return an array containing the publication queues.""" return ok_200(api_core.get_publisher_queues(), include_properties=True)