Merge branch 'release/v13.44'
This commit is contained in:
@@ -6,6 +6,7 @@ import os
|
||||
PY3K = sys.version_info >= (3, 0)
|
||||
|
||||
import zipfile
|
||||
from zipfile import BadZipFile
|
||||
import re
|
||||
import time
|
||||
from time import strftime
|
||||
@@ -240,18 +241,21 @@ class Command(BaseCommand):
|
||||
attachment.delete()
|
||||
for rower in rowers:
|
||||
if 'zip' in extension:
|
||||
zip_file = zipfile.ZipFile(attachment.document)
|
||||
for id,filename in enumerate(zip_file.namelist()):
|
||||
datafile = zip_file.extract(
|
||||
filename, path='media/')
|
||||
if id>0:
|
||||
title = name+' ('+str(id+1)+')'
|
||||
else:
|
||||
title = name
|
||||
workoutid = processattachment(
|
||||
rower, datafile, title, uploadoptions,
|
||||
testing=testing
|
||||
)
|
||||
try:
|
||||
zip_file = zipfile.ZipFile(attachment.document)
|
||||
for id,filename in enumerate(zip_file.namelist()):
|
||||
datafile = zip_file.extract(
|
||||
filename, path='media/')
|
||||
if id>0:
|
||||
title = name+' ('+str(id+1)+')'
|
||||
else:
|
||||
title = name
|
||||
workoutid = processattachment(
|
||||
rower, datafile, title, uploadoptions,
|
||||
testing=testing
|
||||
)
|
||||
except BadZipFile:
|
||||
pass
|
||||
|
||||
else:
|
||||
# move attachment and make workout
|
||||
@@ -296,9 +300,9 @@ class Command(BaseCommand):
|
||||
message.delete()
|
||||
|
||||
# Strava
|
||||
rowers = Rower.objects.filter(strava_auto_import=True)
|
||||
for r in rowers:
|
||||
stravastuff.get_strava_workouts(r)
|
||||
#rowers = Rower.objects.filter(strava_auto_import=True)
|
||||
#for r in rowers:
|
||||
# stravastuff.get_strava_workouts(r)
|
||||
|
||||
self.stdout.write(self.style.SUCCESS(
|
||||
'Successfully processed email attachments'))
|
||||
|
||||
@@ -3442,7 +3442,7 @@ class RowerExportForm(ModelForm):
|
||||
'runkeeper_auto_export',
|
||||
'sporttracks_auto_export',
|
||||
'strava_auto_export',
|
||||
'strava_auto_import',
|
||||
#'strava_auto_import',
|
||||
'trainingpeaks_auto_export',
|
||||
]
|
||||
|
||||
|
||||
@@ -1083,7 +1083,7 @@ def strava_webhook_view(request):
|
||||
return HttpResponse(status=200)
|
||||
try:
|
||||
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
||||
if len(ws) == 0:
|
||||
if ws.count() == 0:
|
||||
return HttpResponse(status=200)
|
||||
except Workout.DoesNotExist:
|
||||
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
|
||||
|
||||
Reference in New Issue
Block a user