From: Yoan Le Clanche Date: Wed, 1 Dec 2021 16:06:04 +0000 (+0100) Subject: Fix seminar progress with webclass conference : https://trackers.pilotsystems.net... X-Git-Tag: 2.8.1-pro~119^2~5 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6ffd982bfc4cd393f71384fc48697fb9f7ca57fe;p=teleforma.git Fix seminar progress with webclass conference : https://trackers.pilotsystems.net/prebarreau/0307 --- diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index 2b210929..b4cf33d0 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -61,15 +61,18 @@ def seminar_progress(user, seminar, more=False): { 'obj': seminar.docs_correct, 'step': '5' - }] - if seminar.conference and seminar.conference.webclass: - objects[2]['obj'] = seminar.conference + } + ] + if seminar.conference and seminar.conference.webclass and seminar.conference in user.auditor.get().conferences.all(): + objects[1]['obj'] = seminar.conference for item in objects: + obj = item['obj'] step = item['step'] items = [obj] if hasattr(obj, 'all'): items = obj.all() + for item in items: if item.weight: total += item.weight @@ -109,6 +112,7 @@ def seminar_progress(user, seminar, more=False): progress = int(progress*100/total) else: progress = 0 + if not more: return progress else: diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index b9da46f3..756590bf 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -170,7 +170,7 @@ {% endwith %} - {% if seminar.conference.webclass and not seminar.medias.all.count %} + {% if seminar.conference.webclass and seminar.conference in user.auditor.get.conferences.all %} {% with seminar.conference as webclass %}
@@ -216,7 +216,6 @@
{% endwith %} - {% if seminar.conference.webclass or not seminar.conference in user.auditor.get.conferences.all %} {% with seminar.question as questions %}
@@ -242,27 +241,25 @@ {% if seminar_progress == 100 %} - {% with seminar.form as form %} -
-
-

{% trans "Step" %} 6 : - {% trans "evaluate the seminar" %}

+ {% with seminar.form as form %} +
+
+

{% trans "Step" %} 6 : + {% trans "evaluate the seminar" %}

+
+ {% include "teleforma/inc/evaluation_form.html" %}
- {% include "teleforma/inc/evaluation_form.html" %} -
- {% endwith %} + {% endwith %} {% endif %} {% if seminar_validated and seminar_progress == 100 and delta_sec >= 0 %} -
-
-

{% trans "Step" %} 7 : - {% trans "download your testimonial" %}

+
+
+

{% trans "Step" %} 7 : + {% trans "download your testimonial" %}

+
+ {% include "teleforma/inc/testimonial_list.html" %}
- {% include "teleforma/inc/testimonial_list.html" %} -
- {% endif %} - {% endif %} {% endblock course_content %}