Merge tag 'v7.38' into develop
bug fixes
This commit is contained in:
@@ -5,11 +5,11 @@ import hashlib
|
|||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
def format_pace_tick(x,pos=None):
|
def format_pace_tick(x,pos=None):
|
||||||
min=int(x/60)
|
minu=int(x/60)
|
||||||
sec=int(x-min*60.)
|
sec=int(x-minu*60.)
|
||||||
sec_str=str(sec).zfill(2)
|
sec_str=str(sec).zfill(2)
|
||||||
template='%d:%s'
|
template='%d:%s'
|
||||||
return template % (min,sec_str)
|
return template % (minu,sec_str)
|
||||||
|
|
||||||
def format_time_tick(x,pos=None):
|
def format_time_tick(x,pos=None):
|
||||||
hour=int(x/3600)
|
hour=int(x/3600)
|
||||||
@@ -109,12 +109,15 @@ def handle_uploaded_image(i):
|
|||||||
hsize = int((float(image.size[1])*float(wpercent)))
|
hsize = int((float(image.size[1])*float(wpercent)))
|
||||||
image = image.resize((basewidth,hsize), Image.ANTIALIAS)
|
image = image.resize((basewidth,hsize), Image.ANTIALIAS)
|
||||||
|
|
||||||
if exif[orientation] == 3:
|
try:
|
||||||
image=image.rotate(180, expand=True)
|
if exif[orientation] == 3:
|
||||||
elif exif[orientation] == 6:
|
image=image.rotate(180, expand=True)
|
||||||
image=image.rotate(270, expand=True)
|
elif exif[orientation] == 6:
|
||||||
elif exif[orientation] == 8:
|
image=image.rotate(270, expand=True)
|
||||||
image=image.rotate(90, expand=True)
|
elif exif[orientation] == 8:
|
||||||
|
image=image.rotate(90, expand=True)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
filename = hashlib.md5(imagefile.getvalue()).hexdigest()+'.jpg'
|
filename = hashlib.md5(imagefile.getvalue()).hexdigest()+'.jpg'
|
||||||
|
|
||||||
|
|||||||
@@ -9207,7 +9207,12 @@ def workout_stravaimport_view(request,message=""):
|
|||||||
start_date = item['start_date']
|
start_date = item['start_date']
|
||||||
stravaid = item['id']
|
stravaid = item['id']
|
||||||
if arrow.get(start_date) == arrow.get(w.startdatetime):
|
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.uploadedtostrava = int(stravaid)
|
||||||
w.save()
|
w.save()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user