Commit 53ad6c27 authored by Marko Kuder's avatar Marko Kuder
Browse files

fix archiver size parsing - make it work for strings

parent 65a183c1
......@@ -2772,7 +2772,11 @@ def human_size(num):
def get_resource_size_formatted(resource_dict):
if resource_dict and resource_dict.get('archiver') and resource_dict['archiver'].get('size'):
size = resource_dict['archiver'].get('size')
try:
size = int(resource_dict['archiver'].get('size'))
except ValueError:
log.error("Could not convert resource size " + resource_dict['archiver'].get('size') + " to integer!")
return None
if not isinstance(size, numbers.Number) or size <= 0:
return None
return human_size(size)
......
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