Skip to content

Commit

Permalink
Merge pull request #412 from salopensource/none_size
Browse files Browse the repository at this point in the history
Handle the size being None
  • Loading branch information
grahamgilbert authored Jan 8, 2021
2 parents 48bee7d + e1db98f commit d377fd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sal/version.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>version</key>
<string>4.1.7.2172</string>
<string>4.1.8.2179</string>
</dict>
</plist>
12 changes: 6 additions & 6 deletions server/templatetags/dashboard_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def human_readable_size(size_in_bytes, base2=True):
"""
try:
size_in_bytes = float(size_in_bytes)
except ValueError:
except (ValueError, TypeError):
size_in_bytes = 0
base, suffix = (1024.0, 'iB') if base2 else (1000.0, 'B')
base, suffix = (1024.0, "iB") if base2 else (1000.0, "B")
# Build an iterable of suffixes to work through.
for x in ['B'] + list(map(lambda x: x + suffix, list('kMGTP'))):
for x in ["B"] + list(map(lambda x: x + suffix, list("kMGTP"))):
if -base < size_in_bytes < base:
return f"{size_in_bytes:.2f} {x}"
size_in_bytes /= base
Expand All @@ -59,10 +59,10 @@ def cat(arg1, arg2):

@register.filter
def macos(os_version):
if LooseVersion(os_version) > LooseVersion('10.11.99'):
return 'macOS'
if LooseVersion(os_version) > LooseVersion("10.11.99"):
return "macOS"
else:
return 'OS X'
return "OS X"


@register.filter
Expand Down
2 changes: 1 addition & 1 deletion set_build_no.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

current_version="4.1.7"
current_version="4.1.8"
pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd`

Expand Down

0 comments on commit d377fd2

Please sign in to comment.