Commit 550e95fe authored by Luciano Cauzzi's avatar Luciano Cauzzi

Minor fixes

parent 9166e3f8
......@@ -48,7 +48,7 @@ class AppPyramidManager:
@staticmethod
def __manage_response__(status_code: int, operation_name: str, result):
if status_code == 200:
logger.debug("[PYRAMID]" + operation_name + ": SUCCEED!")
# logger.debug("[PYRAMID]" + operation_name + ": SUCCEED!")
return NetworkResult(success=True, status_code=200, message="", result=result)
else:
logger.error("[PYRAMID]" + operation_name + ": FAILED!")
......@@ -97,14 +97,14 @@ class AppPyramidManager:
if response.status_code != 200:
return NetworkResult(success=False, status_code=response.status_code, message="", result=None)
if len(attachments) > 0:
return NetworkResult(success=True, status_code=response.status_code, message="", result=True)
return NetworkResult(success=True, status_code=response.status_code, message=json_obj["hits"]["hits"][0]["_id"], result=True)
else:
return NetworkResult(success=True, status_code=response.status_code, message="", result=False)
except Exception as e:
return AppPyramidManager.__generate_generic_error__(operation_name, e)
def update(self, elastic_id: str, doc: PyramidDocument) -> NetworkResult:
operation_name = "saving document"
operation_name = "updating document"
self.__perform_auth_if_needed__()
try:
url = "{}/{}/{}".format(self.__base_url__, self.__res_url__, elastic_id)
......
......@@ -3,7 +3,7 @@ import setuptools
setup(
name='network_manager',
version='0.1.7',
version='0.1.8',
packages=setuptools.find_packages(),
dependency_links=['http://github.comune.brescia.it/innovation-that-excites/logger_library#egg=logger_library'],
install_requires=['logger_library', 'dependency_injector', 'requests'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment