Private
Public Access
1
0

fixing some issues

This commit is contained in:
2025-09-08 16:03:45 +02:00
parent 4d26dafba5
commit aa6cb10dc5
4 changed files with 22 additions and 6 deletions

View File

@@ -1673,6 +1673,8 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
data = pl.collect_all(data)
except ComputeError:
return pl.DataFrame()
except FileNotFoundError:
return pl.DataFrame()
if len(data)==0:
return pl.DataFrame()

View File

@@ -2029,8 +2029,14 @@ class TrainingPlan(models.Model):
name = self.name
startdate = self.startdate
enddate = self.enddate
try:
firstname = self.manager.user.first_name
except AttributeError: # pragma: no cover
firstname = ''
try:
lastname = self.manager.user.last_name
except AttributeError:
lastname = ''
stri = u'Training Plan by {firstname} {lastname} {s} - {e}: {name}'.format(
s=startdate.strftime('%Y-%m-%d'),
@@ -4292,7 +4298,7 @@ class VirtualRaceResult(models.Model):
if self.entrycategory is not None and other.entrycategory is not None:
if self.entrycategory != other.entrycategory:
return False
elif self.entrycategory is None and other.entrycateogry is not None:
elif self.entrycategory is None and other.entrycategory is not None:
return False
elif self.entrycategory is not None and other.entrycategory is None:
return False

View File

@@ -4183,7 +4183,12 @@ def handle_split_workout_by_intervals(id, debug=False, **kwargs):
messages.error(request,"No Data file found for this workout")
return HttpResponseRedirect(url)
try:
new_rowdata = rowdata.split_by_intervals()
except KeyError:
new_rowdata = rowdata
return 0
interval_i = 1
for data in new_rowdata:
filename = 'media/{code}.csv'.format(
@@ -4361,7 +4366,10 @@ def fetch_strava_workout(stravatoken, oauth_data, stravaid, csvfilename, userid,
try:
rowdatetime = iso8601.parse_date(workoutsummary['date_utc'])
except KeyError:
try:
rowdatetime = iso8601.parse_date(workoutsummary['start_date'])
except KeyError:
rowdatetime = iso8601.parse_date(workoutsummary['date'])
except ParseError: # pragma: no cover
rowdatetime = iso8601.parse_date(workoutsummary['date'])

Binary file not shown.