From f5881763aed20507f9d2bc4c1e9a96ce84c629bf Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 13 Jul 2022 09:49:04 +0200 Subject: [PATCH] API - update messages on gpx related errors --- fittrackee/tests/workouts/test_workouts_api_1_post.py | 6 +++--- fittrackee/workouts/utils/workouts.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fittrackee/tests/workouts/test_workouts_api_1_post.py b/fittrackee/tests/workouts/test_workouts_api_1_post.py index a77dbd0e..292a639a 100644 --- a/fittrackee/tests/workouts/test_workouts_api_1_post.py +++ b/fittrackee/tests/workouts/test_workouts_api_1_post.py @@ -586,7 +586,7 @@ class TestPostWorkoutWithGpx(ApiTestCaseMixin, CallArgsMixin): ), ) - data = self.assert_500(response, 'Error during gpx processing.') + data = self.assert_500(response, 'error during gpx processing') assert 'data' not in data def test_it_returns_500_if_gpx_has_invalid_xml( @@ -615,7 +615,7 @@ class TestPostWorkoutWithGpx(ApiTestCaseMixin, CallArgsMixin): ), ) - data = self.assert_500(response, 'Error during gpx file parsing.') + data = self.assert_500(response, 'error during gpx file parsing') assert 'data' not in data def test_it_returns_400_if_workout_gpx_has_invalid_extension( @@ -954,7 +954,7 @@ class TestPostWorkoutWithZipArchive(ApiTestCaseMixin): ), ) - data = self.assert_500(response, 'Error during gpx processing.') + data = self.assert_500(response, 'error during gpx processing') assert 'data' not in data def test_it_imports_only_max_number_of_files( diff --git a/fittrackee/workouts/utils/workouts.py b/fittrackee/workouts/utils/workouts.py index 8c5650d0..0e8e3fd3 100644 --- a/fittrackee/workouts/utils/workouts.py +++ b/fittrackee/workouts/utils/workouts.py @@ -307,9 +307,9 @@ def process_one_gpx_file( absolute_map_filepath = get_absolute_file_path(map_filepath) generate_map(absolute_map_filepath, map_data) except (gpxpy.gpx.GPXXMLSyntaxException, TypeError) as e: - raise WorkoutException('error', 'Error during gpx file parsing.', e) + raise WorkoutException('error', 'error during gpx file parsing', e) except Exception as e: - raise WorkoutException('error', 'Error during gpx processing.', e) + raise WorkoutException('error', 'error during gpx processing', e) try: new_workout = create_workout(