Private
Public Access
1
0

Merge branch 'release/v6.62'

This commit is contained in:
Sander Roosendaal
2018-05-11 09:51:35 +02:00
8 changed files with 28 additions and 5 deletions

View File

@@ -2199,15 +2199,16 @@ def interactive_chart(id=0,promember=0):
hover.mode = 'mouse' hover.mode = 'mouse'
plot.extra_y_ranges["hrax"] = Range1d(start=100,end=200) plot.extra_y_ranges["spmax"] = Range1d(start=10,end=45)
plot.line('time','hr',source=source,color="red", plot.line('time','spm',source=source,color="red",
y_range_name="hrax", legend="Heart Rate") y_range_name="spmax", legend="Stroke Rate")
plot.add_layout(LinearAxis(y_range_name="hrax",axis_label="HR"),'right') plot.add_layout(LinearAxis(y_range_name="spmax",axis_label="SPM"),'right')
plot.legend.location = "bottom_right" plot.legend.location = "bottom_right"
script, div = components(plot) script, div = components(plot)
return [script,div] return [script,div]
def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',

View File

@@ -1349,6 +1349,7 @@ class VirtualRaceResult(models.Model):
verbose_name='Weight Category') verbose_name='Weight Category')
race = models.ForeignKey(VirtualRace) race = models.ForeignKey(VirtualRace)
duration = models.TimeField(default=datetime.time(1,0)) duration = models.TimeField(default=datetime.time(1,0))
distance = models.IntegerField(default=0)
boattype = models.CharField(choices=boattypes,max_length=40, boattype = models.CharField(choices=boattypes,max_length=40,
default='1x', default='1x',
verbose_name = 'Boat Type' verbose_name = 'Boat Type'

View File

@@ -720,6 +720,7 @@ def add_workout_race(ws,race,r):
return result,comments, errors return result,comments, errors
record.coursecompleted=coursecompleted record.coursecompleted=coursecompleted
record.distance = int(coursemeters)
record.workoutid=ws[0].id record.workoutid=ws[0].id
record.duration = duration record.duration = duration
record.save() record.save()

View File

@@ -102,6 +102,11 @@ def do_refresh_token(refreshtoken):
refresh_token = token_json['refresh_token'] refresh_token = token_json['refresh_token']
except KeyError: except KeyError:
refresh_token = refreshtoken refresh_token = refreshtoken
try:
expires_in = int(expires_in)
except (TypeError,ValueError):
expires_in = 0
return [thetoken,expires_in,refresh_token] return [thetoken,expires_in,refresh_token]
@@ -131,6 +136,10 @@ def get_token(code):
refresh_token = token_json['refresh_token'] refresh_token = token_json['refresh_token']
except KeyError: except KeyError:
refresh_token = refreshtoken refresh_token = refreshtoken
try:
expires_in = int(expires_in)
except (ValueError,TypeError):
expires_in = 0
else: else:
return [0,0,0] return [0,0,0]

View File

@@ -40,7 +40,7 @@
<th>Country</th><td>{{ course.country }}</td> <th>Country</th><td>{{ course.country }}</td>
</tr> </tr>
<tr> <tr>
<th>Notes</th><td>{{ course.notes }}</td> <th>Notes</th><td>{{ course.notes|linebreaks }}</td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@@ -8,6 +8,7 @@
<th>Event</th> <th>Event</th>
<th>Country</th> <th>Country</th>
<th>Course</th> <th>Course</th>
<th>Distance</th>
<th>Click for Details</th> <th>Click for Details</th>
</tr> </tr>
</thead> </thead>
@@ -25,6 +26,7 @@
<td><a href="/rowers/virtualevent/{{ race.id }}">{{ race.name }}</a></td> <td><a href="/rowers/virtualevent/{{ race.id }}">{{ race.name }}</a></td>
<td>{{ race.course.country }}</td> <td>{{ race.course.country }}</td>
<td><a href="/rowers/courses/{{ race.course.id }}">{{ race.course.name }}</a></td> <td><a href="/rowers/courses/{{ race.course.id }}">{{ race.course.name }}</a></td>
<td>{{ race.sessionvalue }} m</td>
<td> <td>
{% if rower %} {% if rower %}
{% if race|can_register:rower %} {% if race|can_register:rower %}

View File

@@ -23,6 +23,9 @@
<tr> <tr>
<th>Course</th><td>{{ race.course }}</td> <th>Course</th><td>{{ race.course }}</td>
</tr> </tr>
<tr>
<th>Distance</th><td>{{ race.sessionvalue }} m</td>
</tr>
<tr> <tr>
<th>Registration closure</th> <th>Registration closure</th>
<td>{{ race.registration_closure }}</td> <td>{{ race.registration_closure }}</td>
@@ -98,6 +101,7 @@
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Boat</th> <th>Boat</th>
<th>Time</th> <th>Time</th>
<th>Distance</th>
<th>Details</th> <th>Details</th>
</tr> </tr>
</thead> </thead>
@@ -114,6 +118,7 @@
<td>{{ result.weightcategory }}</td> <td>{{ result.weightcategory }}</td>
<td>{{ result.boattype }}</td> <td>{{ result.boattype }}</td>
<td>{{ result.duration |durationprint:"%H:%M:%S.%f" }}</td> <td>{{ result.duration |durationprint:"%H:%M:%S.%f" }}</td>
<td>{{ result.distance }} m</td>
<td> <td>
<a href="/rowers/workout/{{ result.workoutid }}"> <a href="/rowers/workout/{{ result.workoutid }}">
Details</a></td> Details</a></td>

View File

@@ -2662,6 +2662,7 @@ def rower_process_sporttrackscallback(request):
access_token = res[0] access_token = res[0]
expires_in = res[1] expires_in = res[1]
refresh_token = res[2] refresh_token = res[2]
expirydatetime = timezone.now()+datetime.timedelta(seconds=expires_in) expirydatetime = timezone.now()+datetime.timedelta(seconds=expires_in)
r = getrower(request.user) r = getrower(request.user)
@@ -9597,6 +9598,8 @@ def workout_sporttracksimport_view(request,message=""):
if (r.sporttrackstoken == '') or (r.sporttrackstoken is None): if (r.sporttrackstoken == '') or (r.sporttrackstoken is None):
s = "Token doesn't exist. Need to authorize" s = "Token doesn't exist. Need to authorize"
return HttpResponseRedirect("/rowers/me/sporttracksauthorize/") return HttpResponseRedirect("/rowers/me/sporttracksauthorize/")
else:
return HttpResponseRedirect("/rowers/me/sporttracksrefresh/")
message = "Something went wrong in workout_sporttracksimport_view" message = "Something went wrong in workout_sporttracksimport_view"
messages.error(request,message) messages.error(request,message)
if settings.DEBUG: if settings.DEBUG:
@@ -13624,6 +13627,7 @@ def virtualevent_create_view(request):
course=geocourse, course=geocourse,
comment=comment, comment=comment,
sessiontype = 'coursetest', sessiontype = 'coursetest',
sessionvalue = sessionvalue,
timezone=timezone_str, timezone=timezone_str,
evaluation_closure=evaluation_closure, evaluation_closure=evaluation_closure,
registration_closure=registration_closure, registration_closure=registration_closure,