fixed initials
This commit is contained in:
@@ -246,6 +246,24 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
rowers = []
|
||||
durations = []
|
||||
|
||||
rowersinitials = {}
|
||||
seen = ['seen']
|
||||
idseen = []
|
||||
|
||||
for w in workouts:
|
||||
aantal=1
|
||||
initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal]
|
||||
if w.user.id not in idseen:
|
||||
while initials in seen:
|
||||
aantal += 1
|
||||
initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal]
|
||||
|
||||
seen.append(initials)
|
||||
idseen.append(w.user.id)
|
||||
rowersinitials[w.user.id] = initials
|
||||
|
||||
|
||||
|
||||
for w in workouts:
|
||||
dd = w.date.strftime('%m/%d')
|
||||
dd2 = w.date.strftime('%Y/%m/%d')
|
||||
@@ -256,7 +274,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
|
||||
types.append(w.workouttype)
|
||||
try:
|
||||
rowers.append(w.user.user.first_name[0]+w.user.user.last_name[0])
|
||||
rowers.append(rowersinitials[w.user.id])
|
||||
except IndexError:
|
||||
rowers.append(str(w.user))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user