From fd3f8b2f1fdd9d49ef7c1a792d827d88c25986f1 Mon Sep 17 00:00:00 2001 From: rutvikrj26 Date: Wed, 13 Sep 2023 12:37:45 -0400 Subject: [PATCH] fixed the version comparision Please enter commit message for your changes. Lines starting --- physionet-django/training/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/physionet-django/training/views.py b/physionet-django/training/views.py index b83ca6cb66..1c6a9069d6 100644 --- a/physionet-django/training/views.py +++ b/physionet-django/training/views.py @@ -50,7 +50,8 @@ def courses(request): if not all(map(lambda x: x.isdigit() or x == '.', str(file_data['courses'][0]['version']))): messages.error(request, 'Version number is not valid.') # checking if the version number is greater than the existing version - elif float(file_data['courses'][0]['version']) <= float(existing_course.order_by('-version').first().version): + elif float(file_data['courses'][0]['version'] + ) <= float(existing_course.order_by('-version').first().version): messages.error(request, 'Version number should be greater than the existing version.') else: # Checks passed and moving to saving the course serializer = TrainingTypeSerializer(training_type, data=file_data, partial=True)