Merge branch 'bugfix/listworkouts' into develop
This commit is contained in:
@@ -236,7 +236,10 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
dates.append(dd)
|
||||
durations.append(du)
|
||||
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:
|
||||
d = utc.localize(startdate)
|
||||
|
||||
@@ -987,6 +987,14 @@ class UserForm(ModelForm):
|
||||
model = User
|
||||
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):
|
||||
email = self.cleaned_data.get('email')
|
||||
|
||||
|
||||
@@ -117,7 +117,11 @@
|
||||
<div class="grid_1 tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p>
|
||||
{% if user.first_name %}
|
||||
<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>
|
||||
<span class="tooltiptext">Edit user account, e.g. heart rate zones, power zones, email, teams</span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user