Adding TypeError(fixes #2424)
This commit is contained in:
parent
66aa42021a
commit
956cd05119
@ -13,7 +13,7 @@ def convert_duration(apps, schema_editor):
|
|||||||
if is_int(duration):
|
if is_int(duration):
|
||||||
# assuming that these are minutes
|
# assuming that these are minutes
|
||||||
item.duration_tmp = int(duration)
|
item.duration_tmp = int(duration)
|
||||||
else:
|
elif isinstance(duration, str):
|
||||||
split = duration.split(':')
|
split = duration.split(':')
|
||||||
# assuming format (h)h:(m)m
|
# assuming format (h)h:(m)m
|
||||||
if len(split) == 2 and is_int(split[0]) and is_int(split[1]):
|
if len(split) == 2 and is_int(split[0]) and is_int(split[1]):
|
||||||
@ -25,7 +25,7 @@ def convert_duration(apps, schema_editor):
|
|||||||
def is_int(s):
|
def is_int(s):
|
||||||
try:
|
try:
|
||||||
int(s)
|
int(s)
|
||||||
except ValueError:
|
except (ValueError, TypeError):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user