Changeset eaef731 in OpenWorkouts-current


Ignore:
Timestamp:
Jan 16, 2019, 1:04:13 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
b030195
Parents:
e0e2c10
Message:

When calling load_from_fit() on an existing workout, look if the user provided

a new fit file before loading, ensure an existing fit file is not overrided by
the generated gpx file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/models/workout.py

    re0e2c10 reaef731  
    350350        4. Grab some basic info from the fit file and store it in the Workout
    351351        """
    352         # backup the fit file
    353         self.fit_file = copy_blob(self.tracking_file)
     352
     353        # we can call load_from_fit afterwards for updates. In such case, check
     354        # if the tracking file is a fit file uploaded to override the previous
     355        # one. If not, just reuse the existing fit file
     356        if self.tracking_filetype == 'fit':
     357            # backup the fit file
     358            self.fit_file = copy_blob(self.tracking_file)
    354359
    355360        # create an instance of our Fit class
Note: See TracChangeset for help on using the changeset viewer.