Bug fix
This commit is contained in:
parent
58309624c9
commit
0be86dcc39
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<a href="{% url 'generate_best_straightjump_listing' %}">10 chandelles</a>
|
<a href="{% url 'generate_best_straightjump_listing' %}">Personal best 10 chandelles</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -839,7 +839,6 @@ def generate_week_report(request, gymnast_id, season=None, week_number=None):
|
||||||
height_weight_queryset = HeightWeight.objects.filter(gymnast=gymnast).order_by(
|
height_weight_queryset = HeightWeight.objects.filter(gymnast=gymnast).order_by(
|
||||||
"-date"
|
"-date"
|
||||||
)
|
)
|
||||||
|
|
||||||
if height_weight_week_value["mean_height_value"]:
|
if height_weight_week_value["mean_height_value"]:
|
||||||
lasts_height = list(
|
lasts_height = list(
|
||||||
height_weight_queryset.values_list("height", flat=True)[1:6]
|
height_weight_queryset.values_list("height", flat=True)[1:6]
|
||||||
|
@ -870,7 +869,6 @@ def generate_week_report(request, gymnast_id, season=None, week_number=None):
|
||||||
mean_number_of_passes_value=Avg("number_of_passes"),
|
mean_number_of_passes_value=Avg("number_of_passes"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# BEST TOF
|
# BEST TOF
|
||||||
#
|
#
|
||||||
|
@ -892,7 +890,6 @@ def generate_week_report(request, gymnast_id, season=None, week_number=None):
|
||||||
.order_by("-score")
|
.order_by("-score")
|
||||||
.first()
|
.first()
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# BEST SCORES
|
# BEST SCORES
|
||||||
#
|
#
|
||||||
|
@ -926,7 +923,6 @@ def generate_week_report(request, gymnast_id, season=None, week_number=None):
|
||||||
.order_by("-total")
|
.order_by("-total")
|
||||||
.first()
|
.first()
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# ROUTINES
|
# ROUTINES
|
||||||
#
|
#
|
||||||
|
@ -1004,7 +1000,6 @@ def generate_week_report(request, gymnast_id, season=None, week_number=None):
|
||||||
total_try=Sum("number_of_try"), total_succeeded=Sum("number_of_successes")
|
total_try=Sum("number_of_try"), total_succeeded=Sum("number_of_successes")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# LAST LEARNED SKILLS
|
# LAST LEARNED SKILLS
|
||||||
#
|
#
|
||||||
|
@ -1104,7 +1099,7 @@ def generate_week_report(request, gymnast_id, season=None, week_number=None):
|
||||||
firstname=gymnast.first_name,
|
firstname=gymnast.first_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
html = render_to_string("people/gymnasts/reports/report_week.html", context)
|
html = render_to_string("gymnasts/reports/report_week.html", context)
|
||||||
|
|
||||||
# font_config = FontConfiguration()
|
# font_config = FontConfiguration()
|
||||||
HTML(string=html, base_url=request.build_absolute_uri()).write_pdf(
|
HTML(string=html, base_url=request.build_absolute_uri()).write_pdf(
|
||||||
|
|
|
@ -31,7 +31,7 @@ def from_week_number_to_date(season, week_number):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
dash = season.find("-")
|
dash = season.find("-")
|
||||||
first_year = season[:dash]
|
first_year = str(season[:dash])
|
||||||
season_begin = pendulum.parse(str(first_year) + "09-01")
|
season_begin = pendulum.parse(str(first_year) + "09-01")
|
||||||
season_first_week = season_begin.week_of_year
|
season_first_week = season_begin.week_of_year
|
||||||
rest_of_week = 52 - season_first_week
|
rest_of_week = 52 - season_first_week
|
||||||
|
@ -44,7 +44,7 @@ def from_week_number_to_date(season, week_number):
|
||||||
week_number -= rest_of_week
|
week_number -= rest_of_week
|
||||||
year = str(season[dash + 1 :])
|
year = str(season[dash + 1 :])
|
||||||
|
|
||||||
if week_number - rest_of_week < 10:
|
if week_number < 10:
|
||||||
week_string += "0"
|
week_string += "0"
|
||||||
|
|
||||||
start_date = pendulum.parse(year + week_string + str(week_number))
|
start_date = pendulum.parse(year + week_string + str(week_number))
|
||||||
|
|
Loading…
Reference in New Issue