Fix bug into routine compute_informations function
This commit is contained in:
parent
75599d32c5
commit
eeb638291a
|
@ -299,7 +299,7 @@ class Routine(Educative):
|
||||||
age_boy_masterised = 0
|
age_boy_masterised = 0
|
||||||
age_girl_masterised = 0
|
age_girl_masterised = 0
|
||||||
difficulty = 0
|
difficulty = 0
|
||||||
is_routine = False
|
# is_routine = False
|
||||||
is_competitive = True
|
is_competitive = True
|
||||||
|
|
||||||
for skill_link in self.skill_links.all():
|
for skill_link in self.skill_links.all():
|
||||||
|
@ -338,8 +338,10 @@ class Routine(Educative):
|
||||||
skill.age_girl_masterised, age_girl_masterised
|
skill.age_girl_masterised, age_girl_masterised
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.skill_links.all().count() < 5:
|
# Je ne sais plus pourquoi j'ai mis ce bout de code.
|
||||||
is_routine = False
|
# if self.skill_links.all().count() < 5:
|
||||||
|
# is_routine = False
|
||||||
|
# print("Not a routine.")
|
||||||
|
|
||||||
if not self.is_routine:
|
if not self.is_routine:
|
||||||
is_competitive = False
|
is_competitive = False
|
||||||
|
@ -347,7 +349,7 @@ class Routine(Educative):
|
||||||
if self.skill_links.all().count() != 10:
|
if self.skill_links.all().count() != 10:
|
||||||
is_competitive = False
|
is_competitive = False
|
||||||
|
|
||||||
self.is_routine = is_routine
|
# self.is_routine = is_routine
|
||||||
self.is_competitive = is_competitive
|
self.is_competitive = is_competitive
|
||||||
|
|
||||||
self.difficulty = difficulty
|
self.difficulty = difficulty
|
||||||
|
|
|
@ -33,26 +33,25 @@
|
||||||
<div class="col-3 text-center">Age Boy : <a href="#">{{ routine.age_boy_masterised }}</a></div>
|
<div class="col-3 text-center">Age Boy : <a href="#">{{ routine.age_boy_masterised }}</a></div>
|
||||||
<div class="col-3 text-center">Age Girl : <a href="#">{{ routine.age_girl_masterised }}</a></div>
|
<div class="col-3 text-center">Age Girl : <a href="#">{{ routine.age_girl_masterised }}</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row mt-2">
|
||||||
<div class="col-6 text-center">Routine : <a href="#">{{ routine.is_routine }}</a></div>
|
<div class="col-6 text-center">Routine : <a href="#">{% if routine.is_routine %}Yes{% else %}No{% endif %}</a></div>
|
||||||
<div class="col-6 text-center">Competition : <a href="#">{{ routine.is_competitive }}</a></div>
|
<div class="col-6 text-center">Competition : <a href="#">{% if routine.is_competitive %}Yes{% else %}No{% endif %}</a></div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No skill defined for this routine.</p>
|
<p>No skill defined for this routine.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if routine.informations %}
|
||||||
|
<div class="col-md-12">
|
||||||
|
<hr class="m-t">
|
||||||
|
<h5><b>Informations</b></h5>
|
||||||
|
<!-- <p>{{ skill.educative }}</p> -->
|
||||||
|
<span id="comment">
|
||||||
|
{{ routine.to_markdown | safe }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if routine.informations %}
|
|
||||||
<div class="col-md-12">
|
|
||||||
<hr class="m-t">
|
|
||||||
<h4>Informations</h4>
|
|
||||||
<!-- <p>{{ skill.educative }}</p> -->
|
|
||||||
<span id="comment">
|
|
||||||
{{ routine.to_markdown | safe }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="card-footer row pt-0">
|
<div class="card-footer row pt-0">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<a href="{% url 'routine_listing' %}">
|
<a href="{% url 'routine_listing' %}">
|
||||||
|
|
Loading…
Reference in New Issue