Private
Public Access
1
0

Merge tag 'v7.38' into develop

bug fixes
This commit is contained in:
Sander Roosendaal
2018-07-23 09:31:29 +02:00
2 changed files with 18 additions and 10 deletions

View File

@@ -5,11 +5,11 @@ import hashlib
from django.core.exceptions import ValidationError
def format_pace_tick(x,pos=None):
min=int(x/60)
sec=int(x-min*60.)
minu=int(x/60)
sec=int(x-minu*60.)
sec_str=str(sec).zfill(2)
template='%d:%s'
return template % (min,sec_str)
return template % (minu,sec_str)
def format_time_tick(x,pos=None):
hour=int(x/3600)
@@ -109,12 +109,15 @@ def handle_uploaded_image(i):
hsize = int((float(image.size[1])*float(wpercent)))
image = image.resize((basewidth,hsize), Image.ANTIALIAS)
if exif[orientation] == 3:
image=image.rotate(180, expand=True)
elif exif[orientation] == 6:
image=image.rotate(270, expand=True)
elif exif[orientation] == 8:
image=image.rotate(90, expand=True)
try:
if exif[orientation] == 3:
image=image.rotate(180, expand=True)
elif exif[orientation] == 6:
image=image.rotate(270, expand=True)
elif exif[orientation] == 8:
image=image.rotate(90, expand=True)
except KeyError:
pass
filename = hashlib.md5(imagefile.getvalue()).hexdigest()+'.jpg'

View File

@@ -9207,7 +9207,12 @@ def workout_stravaimport_view(request,message=""):
start_date = item['start_date']
stravaid = item['id']
if arrow.get(start_date) == arrow.get(w.startdatetime):
if datetime.time(seconds=int(elapsed_time)) == w.duration:
elapsed_td = datetime.timedelta(seconds=int(elapsed_time))
elapsed_time = datetime.datetime.strptime(
str(elapsed_td),
"%H:%M:%S"
)
if str(elapsed_time)[-7:] == str(w.duration)[-7:]:
w.uploadedtostrava = int(stravaid)
w.save()