Skip to content

Commit

Permalink
mirrors: silence flake8 E721
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Aug 10, 2023
1 parent 9e4df5f commit e58bb58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mirrors/templatetags/mirror_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@register.filter
def duration(value):
if not value and type(value) != timedelta:
if not value or not isinstance(value, timedelta):
return u''
# does not take microseconds into account
total_secs = value.seconds + value.days * 24 * 3600
Expand All @@ -17,7 +17,7 @@ def duration(value):

@register.filter
def hours(value):
if not value and type(value) != timedelta:
if not value or not isinstance(value, timedelta):
return u''
# does not take microseconds into account
total_secs = value.seconds + value.days * 24 * 3600
Expand All @@ -30,7 +30,7 @@ def hours(value):

@register.filter
def percentage(value, arg=1):
if not value and type(value) != float:
if not value or not isinstance(value, float):
return u''
new_val = value * 100.0
return '%.*f%%' % (arg, new_val)
Expand Down

0 comments on commit e58bb58

Please sign in to comment.