Skip to content

Commit

Permalink
bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
EldarAliiev committed Aug 5, 2017
1 parent 3bc02fc commit fde27c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion edbo_connector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__copyright__ = 'Copyright 2017, National Pirogov Memorial Medical University, Vinnytsya'
__credits__ = ['Eldar Aliiev']
__license__ = 'MIT'
__version__ = '1.0.3-3'
__version__ = '1.0.3-4'
__maintainer__ = 'Eldar Aliiev'
__email__ = '[email protected]'
__status__ = 'Production'
Expand Down
27 changes: 18 additions & 9 deletions edbo_connector/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,13 @@ def get_education_document_image(self, person_request_id: int, save_to: str = No
json_format=False
)

if save_to is not None:
EDBOWebApiHelper.save_image(image.content, save_to)
if image is not None:
if save_to is not None and len(image.content) > 0:
EDBOWebApiHelper.save_image(image.content, save_to)

return image.content, image.headers['Content-Length']
return image.content, image.headers['Content-Length']
else:
return None, None

def get_registration_document_image(self, person_request_id: int, save_to: str = None) -> tuple:
"""Get image with document about registration in village for request
Expand All @@ -264,10 +267,13 @@ def get_registration_document_image(self, person_request_id: int, save_to: str =
json_format=False
)

if save_to is not None:
EDBOWebApiHelper.save_image(image.content, save_to)
if image is not None:
if save_to is not None and len(image.content) > 0:
EDBOWebApiHelper.save_image(image.content, save_to)

return image.content, image.headers['Content-Length']
return image.content, image.headers['Content-Length']
else:
return None, None

def get_person_photo(self, person_request_id: int, save_to: str = None) -> tuple:
"""Get photo of admitter
Expand All @@ -286,7 +292,10 @@ def get_person_photo(self, person_request_id: int, save_to: str = None) -> tuple
json_format=False
)

if save_to is not None:
EDBOWebApiHelper.save_image(image.content, save_to)
if image is not None:
if save_to is not None and len(image.content) > 0:
EDBOWebApiHelper.save_image(image.content, save_to)

return image.content, image.headers['Content-Length']
return image.content, image.headers['Content-Length']
else:
return None, None

0 comments on commit fde27c6

Please sign in to comment.