Private
Public Access
1
0

Merge branch 'release/v5.31'

This commit is contained in:
Sander Roosendaal
2017-12-09 12:05:39 +01:00
6 changed files with 23 additions and 7 deletions
+3 -2
View File
@@ -650,11 +650,11 @@ def create_row_df(r,distance,duration,startdatetime,
step = totalseconds/float(nr_strokes) step = totalseconds/float(nr_strokes)
elapsed = np.arange(0,totalseconds+step,step) elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
dstep = distance/float(nr_strokes) dstep = distance/float(nr_strokes)
d = np.arange(0,distance+dstep,dstep) d = np.arange(nr_strokes)*distance/(float(nr_strokes-1))
unixtime = unixstarttime + elapsed unixtime = unixstarttime + elapsed
@@ -666,6 +666,7 @@ def create_row_df(r,distance,duration,startdatetime,
else: else:
power = 0 power = 0
df = pd.DataFrame({ df = pd.DataFrame({
'TimeStamp (sec)': unixtime, 'TimeStamp (sec)': unixtime,
' Horizontal (meters)': d, ' Horizontal (meters)': d,
+4 -1
View File
@@ -236,7 +236,10 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
dates.append(dd) dates.append(dd)
durations.append(du) durations.append(du)
types.append(w.workouttype) types.append(w.workouttype)
rowers.append(w.user.user.first_name[0]+w.user.user.last_name[0]) try:
rowers.append(w.user.user.first_name[0]+w.user.user.last_name[0])
except IndexError:
rowers.append(str(w.user))
try: try:
d = utc.localize(startdate) d = utc.localize(startdate)
+8
View File
@@ -987,6 +987,14 @@ class UserForm(ModelForm):
model = User model = User
fields = ['first_name','last_name','email'] fields = ['first_name','last_name','email']
def clean_first_name(self):
first_name = self.cleaned_data.get('first_name')
if len(first_name):
return first_name
raise forms.ValidationError('Please fill in your first name')
def clean_email(self): def clean_email(self):
email = self.cleaned_data.get('email') email = self.cleaned_data.get('email')
-1
View File
@@ -3156,7 +3156,6 @@ def addmanual_view(request):
) )
print name
id,message = dataprep.create_row_df(r, id,message = dataprep.create_row_df(r,
distance, distance,
duration,startdatetime, duration,startdatetime,
+4 -3
View File
@@ -229,20 +229,21 @@ PROGRESS_CACHE_SECRET = CFG['progress_cache_secret']
# Concept 2 # Concept 2
C2_CLIENT_ID = CFG['c2_client_id'] C2_CLIENT_ID = CFG['c2_client_id']
C2_CLIENT_SECRET = CFG['c2_client_secret'] C2_CLIENT_SECRET = CFG['c2_client_secret']
C2_REDIRECT_URI = "http://rowsandall.com/call_back" C2_REDIRECT_URI = CFG['c2_callback']
#C2_REDIRECT_URI = "http://localhost:8000/call_back" #C2_REDIRECT_URI = "http://localhost:8000/call_back"
# Strava # Strava
STRAVA_CLIENT_ID = CFG['strava_client_id'] STRAVA_CLIENT_ID = CFG['strava_client_id']
STRAVA_CLIENT_SECRET = CFG['strava_client_secret'] STRAVA_CLIENT_SECRET = CFG['strava_client_secret']
STRAVA_REDIRECT_URI = "http://rowsandall.com/stravacall_back" STRAVA_REDIRECT_URI = CFG['strava_callback']
# SportTracks # SportTracks
SPORTTRACKS_CLIENT_ID = CFG['sporttracks_client_id'] SPORTTRACKS_CLIENT_ID = CFG['sporttracks_client_id']
SPORTTRACKS_CLIENT_SECRET = CFG['sporttracks_client_secret'] SPORTTRACKS_CLIENT_SECRET = CFG['sporttracks_client_secret']
SPORTTRACKS_REDIRECT_URI = "http://rowsandall.com/sporttracks_callback" SPORTTRACKS_REDIRECT_URI = CFG['sporttracks_callback']
# Runkeeper # Runkeeper
+4
View File
@@ -117,7 +117,11 @@
<div class="grid_1 tooltip"> <div class="grid_1 tooltip">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<p> <p>
{% if user.first_name %}
<a class="button gray small" href="/rowers/me/edit">{{ user.first_name }}</a> <a class="button gray small" href="/rowers/me/edit">{{ user.first_name }}</a>
{% else %}
<a class="button gray small" href="/rowers/me/edit">{{ user }}</a>
{% endif %}
</p> </p>
<span class="tooltiptext">Edit user account, e.g. heart rate zones, power zones, email, teams</span> <span class="tooltiptext">Edit user account, e.g. heart rate zones, power zones, email, teams</span>