From e386f466aea733883c71844a1bca86f6f2ef91f9 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 15 Jul 2020 10:10:54 +0200 Subject: [PATCH] API - fix localization --- fittrackee_api/fittrackee_api/users/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fittrackee_api/fittrackee_api/users/utils.py b/fittrackee_api/fittrackee_api/users/utils.py index 2c8c6f6f..e6b08eb7 100644 --- a/fittrackee_api/fittrackee_api/users/utils.py +++ b/fittrackee_api/fittrackee_api/users/utils.py @@ -153,9 +153,9 @@ def display_readable_file_size(size_in_bytes): def get_readable_duration(duration, locale='en'): - if locale != 'en': + if locale is not None and locale != 'en': _t = humanize.i18n.activate(locale) # noqa readable_duration = humanize.naturaldelta(timedelta(seconds=duration)) - if locale != 'en': + if locale is not None and locale != 'en': humanize.i18n.deactivate() return readable_duration