From 956cd05119a3ce3ee65166ef4f963b2e19dec4e2 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 23 Sep 2016 14:42:25 +0200 Subject: [PATCH] Adding TypeError(fixes #2424) --- openslides/agenda/migrations/0002_duration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openslides/agenda/migrations/0002_duration.py b/openslides/agenda/migrations/0002_duration.py index 8ea380bed..35c168c26 100644 --- a/openslides/agenda/migrations/0002_duration.py +++ b/openslides/agenda/migrations/0002_duration.py @@ -13,7 +13,7 @@ def convert_duration(apps, schema_editor): if is_int(duration): # assuming that these are minutes item.duration_tmp = int(duration) - else: + elif isinstance(duration, str): split = duration.split(':') # assuming format (h)h:(m)m 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): try: int(s) - except ValueError: + except (ValueError, TypeError): return False else: return True