kopia lustrzana https://github.com/OpenDroneMap/WebODM
Return 100 when den is zero
rodzic
14aad55245
commit
3541882423
|
@ -32,7 +32,7 @@ def disk_size(megabytes):
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def percentage(num, den, maximum=None):
|
def percentage(num, den, maximum=None):
|
||||||
if den == 0:
|
if den == 0:
|
||||||
return 0
|
return 100
|
||||||
perc = max(0, num / den * 100)
|
perc = max(0, num / den * 100)
|
||||||
if maximum is not None:
|
if maximum is not None:
|
||||||
perc = min(perc, maximum)
|
perc = min(perc, maximum)
|
||||||
|
|
Ładowanie…
Reference in New Issue