From 54375e057643aebbd2ed056596e45cc636fcad39 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 1 Jul 2018 17:48:45 +0200 Subject: [PATCH] gpx limit fix - #19 --- Makefile.custom.config.example | 2 +- fittrackee_api/fittrackee_api/activities/utils.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.custom.config.example b/Makefile.custom.config.example index e049c063..c886a363 100644 --- a/Makefile.custom.config.example +++ b/Makefile.custom.config.example @@ -1,7 +1,7 @@ export REACT_APP_API_URL = http://$(HOST):$(API_PORT) export REACT_APP_THUNDERFOREST_API_KEY= -export WEATHER_API= export REACT_APP_GPX_LIMIT_IMPORT=10 +export WEATHER_API= # for dev env export CODACY_PROJECT_TOKEN= diff --git a/fittrackee_api/fittrackee_api/activities/utils.py b/fittrackee_api/fittrackee_api/activities/utils.py index 4e9b3315..3cc40397 100644 --- a/fittrackee_api/fittrackee_api/activities/utils.py +++ b/fittrackee_api/fittrackee_api/activities/utils.py @@ -368,8 +368,9 @@ def process_zip_archive(common_params, extract_dir): zip_ref.extractall(extract_dir) new_activities = [] - if os.getenv('REACT_APP_GPX_LIMIT_IMPORT').isdigit(): - gpx_files_limit = int(os.getenv('REACT_APP_GPX_LIMIT_IMPORT')) + gpx_files_limit = os.getenv('REACT_APP_GPX_LIMIT_IMPORT') + if gpx_files_limit and gpx_files_limit.isdigit(): + gpx_files_limit = int(gpx_files_limit) else: gpx_files_limit = 10 appLog.error('GPX limit not configured, set to 10.')