def run(self): dbi = DBMgr.getInstance() logger = self.getLogger() logger.info("ECOSOC list download task started") try: ECOSOCList.getInstance().update() logger.info("ECOSOC list download finished, persisting....") dbi.commit() logger.info("ECOSOC list download finished, persisted") except Exception as e: logger.exception("ECOSOC list download exception '{}'".format(e))
def _getAnswer(self): try: names = ECOSOCList.getInstance().getNames(self._query, self._full) # names = names if len(names)<30 else names[0:30] return {"suggestions": names} except Exception as e: return {"status": None, "error": "Unable to query iCSO"}
def _getAnswer(self): try: entry = ECOSOCList.getInstance().getStatus(self._organization) status = entry["status"] return {"status": status} except IndexError: return {"status": None, "error": "Organisation not found"} except Exception as e: return {"status": None, "error": "Unable to query iCSO"}