Private
Public Access
1
0

Merge branch 'hotfix/v6.55'

This commit is contained in:
Sander Roosendaal
2018-04-27 09:32:19 +02:00
2 changed files with 8 additions and 2 deletions
+3
View File
@@ -294,7 +294,10 @@ from datetime import date
def calculate_age(born):
today = date.today()
if born:
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
else:
return None
def my_dict_from_instance(instance,model):
thedict = {}
+3
View File
@@ -13579,7 +13579,10 @@ def virtualevent_register_view(request,id=0):
age = cd['age']
else:
weightcategory = r.weightcategory
if r.birthdate:
age = calculate_age(r.birthdate)
else:
age = cd['age']
record = VirtualRaceResult(
userid=r.id,