Private
Public Access
1
0

Merge branch 'release/v3.81'

This commit is contained in:
Sander Roosendaal
2017-09-22 12:28:39 +02:00
6 changed files with 47 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ from pandas import DataFrame,Series
from pytz import timezone as tz,utc from pytz import timezone as tz,utc
from django.utils import timezone from django.utils import timezone
from time import strftime,strptime,mktime,time,daylight from time import strftime,strptime,mktime,time,daylight
import arrow
from django.utils.timezone import get_current_timezone from django.utils.timezone import get_current_timezone
thetimezone = get_current_timezone() thetimezone = get_current_timezone()
from rowingdata import ( from rowingdata import (
@@ -1012,7 +1013,8 @@ def new_workout_from_df(r,df,
df.rename(columns = columndict,inplace=True) df.rename(columns = columndict,inplace=True)
starttimeunix = mktime(startdatetime.utctimetuple()) #starttimeunix = mktime(startdatetime.utctimetuple())
starttimeunix = arrow.get(startdatetime).timestamp
df[' ElapsedTime (sec)'] = df['TimeStamp (sec)'] df[' ElapsedTime (sec)'] = df['TimeStamp (sec)']
df['TimeStamp (sec)'] = df['TimeStamp (sec)']+starttimeunix df['TimeStamp (sec)'] = df['TimeStamp (sec)']+starttimeunix

View File

@@ -691,8 +691,23 @@ def leaflet_chart(lat,lon,name=""):
if lat.empty or lon.empty: if lat.empty or lon.empty:
return [0,"invalid coordinate data"] return [0,"invalid coordinate data"]
# Throw out 0,0
df = pd.DataFrame({
'lat':lat,
'lon':lon
})
df = df.replace(0,np.nan)
df = df.loc[(df!=0).any(axis=1)]
lat = df['lat']
lon = df['lon']
if lat.empty or lon.empty:
return [0,"invalid coordinate data"]
latmean = lat.mean() latmean = lat.mean()
lonmean = lon.mean() lonmean = lon.mean()
latbegin = lat[lat.index[0]] latbegin = lat[lat.index[0]]
longbegin = lon[lon.index[0]] longbegin = lon[lon.index[0]]
latend = lat[lat.index[-1]] latend = lat[lat.index[-1]]
@@ -796,6 +811,20 @@ def leaflet_chart2(lat,lon,name=""):
if lat.empty or lon.empty: if lat.empty or lon.empty:
return [0,"invalid coordinate data"] return [0,"invalid coordinate data"]
# Throw out 0,0
df = pd.DataFrame({
'lat':lat,
'lon':lon
})
df = df.replace(0,np.nan)
df = df.loc[(df!=0).any(axis=1)]
lat = df['lat']
lon = df['lon']
if lat.empty or lon.empty:
return [0,"invalid coordinate data"]
latmean = lat.mean() latmean = lat.mean()
lonmean = lon.mean() lonmean = lon.mean()
latbegin = lat[lat.index[0]] latbegin = lat[lat.index[0]]

View File

@@ -126,6 +126,10 @@
expires, expires,
use the refresh token to refresh it.</p> use the refresh token to refresh it.</p>
<p>The redirect URI for user authentication has to be <i>https</i>.
Developers of iOS or Android apps should contact me directly if
this doesn't work for them. I can add exceptions.</p>
<p>The POST call must have content-type: <i>x-www-form-urlencoded</i>. <p>The POST call must have content-type: <i>x-www-form-urlencoded</i>.
I set it this way to support the handy testing utility mentioned I set it this way to support the handy testing utility mentioned
belower. However, belower. However,

View File

@@ -51,7 +51,7 @@
<table width="100%" class="listtable shortpadded"> <table width="100%" class="listtable shortpadded">
<thead> <thead>
<tr> <tr>
<th style="width:80px"> Date</th> <th style="width:80"> Date</th>
<th> Time</th> <th> Time</th>
<th> Name</th> <th> Name</th>
<th> Type</th> <th> Type</th>
@@ -76,9 +76,9 @@
{% else %} {% else %}
<tr> <tr>
{% endif %} {% endif %}
<td> {{ workout.date |truncatechars:15}} </td> <td> {{ workout.date|date:"Y-m-d" }} </td>
<td> {{ workout.starttime }} </td> <td> {{ workout.starttime|date:"H:i" }} </td>
<td> <td>
{% if workout.user.user == user or user == team.manager %} {% if workout.user.user == user or user == team.manager %}
{% if workout.rankingpiece %} {% if workout.rankingpiece %}
[RANKING PIECE] [RANKING PIECE]

View File

@@ -4341,17 +4341,17 @@ def workouts_view(request,message='',successmessage='',
if theteam.viewing == 'allmembers' or theteam.manager == request.user: if theteam.viewing == 'allmembers' or theteam.manager == request.user:
workouts = Workout.objects.filter(team=theteam, workouts = Workout.objects.filter(team=theteam,
startdatetime__gte=startdate, startdatetime__gte=startdate,
startdatetime__lte=enddate).order_by("-date", "-starttime") startdatetime__lte=enddate).order_by("-startdatetime")
g_workouts = Workout.objects.filter(team=theteam, g_workouts = Workout.objects.filter(team=theteam,
startdatetime__gte=activity_startdate, startdatetime__gte=activity_startdate,
startdatetime__lte=activity_enddate).order_by("-date", "-starttime") startdatetime__lte=activity_enddate).order_by("-date", "-starttime")
elif theteam.viewing == 'coachonly': elif theteam.viewing == 'coachonly':
workouts = Workout.objects.filter(team=theteam,user=r, workouts = Workout.objects.filter(team=theteam,user=r,
startdatetime__gte=startdate, startdatetime__gte=startdate,
startdatetime__lte=enddate).order_by("-date","-starttime") startdatetime__lte=enddate).order_by("-startdatetime")
g_workouts = Workout.objects.filter(team=theteam,user=r, g_workouts = Workout.objects.filter(team=theteam,user=r,
startdatetime__gte=activity_startdate, startdatetime__gte=activity_startdate,
enddatetime__lte=activity_enddate).order_by("-date","-starttime") enddatetime__lte=activity_enddate).order_by("-startdatetime")
else: else:
@@ -4361,7 +4361,7 @@ def workouts_view(request,message='',successmessage='',
startdatetime__lte=enddate).order_by("-date", "-starttime") startdatetime__lte=enddate).order_by("-date", "-starttime")
g_workouts = Workout.objects.filter(user=r, g_workouts = Workout.objects.filter(user=r,
startdatetime__gte=activity_startdate, startdatetime__gte=activity_startdate,
startdatetime__lte=activity_enddate).order_by("-date","-starttime") startdatetime__lte=activity_enddate).order_by("-startdatetime")
query = request.GET.get('q') query = request.GET.get('q')
if query: if query:

View File

@@ -324,6 +324,9 @@ GMAPIKEY = CFG['gmapikey']
OAUTH2_PROVIDER = { OAUTH2_PROVIDER = {
# this is the list of available scopes # this is the list of available scopes
'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'groups': 'Access to your groups'}, 'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'groups': 'Access to your groups'},
'ALLOWED_REDIRECT_URI_SCHEMES': ["http",
"https",
"rowingcoachexport"]
# 'OAUTH2_BACKEND_CLASS': 'oauth2_provider.oauth2_backends.JSONOAuthLibCore' # 'OAUTH2_BACKEND_CLASS': 'oauth2_provider.oauth2_backends.JSONOAuthLibCore'
} }