]> git.parisson.com Git - teleforma.git/commitdiff
Undo : Add testimonial type field on seminar : https://trackers.pilotsystems.net...
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 16 Jan 2023 12:39:02 +0000 (13:39 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 16 Jan 2023 12:39:02 +0000 (13:39 +0100)
teleforma/migrations/0014_seminar_testimonial_type.py [new file with mode: 0644]
teleforma/models/pro.py
teleforma/views/pro.py

diff --git a/teleforma/migrations/0014_seminar_testimonial_type.py b/teleforma/migrations/0014_seminar_testimonial_type.py
new file mode 100644 (file)
index 0000000..22e7937
--- /dev/null
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.3 on 2023-01-16 10:33
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('teleforma', '0013_seminarpart_index'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='seminar',
+            name='testimonial_type',
+            field=models.CharField(blank=True, choices=[('elearning', 'E-learning'), ('blended', 'Blended')], max_length=10, null=True),
+        ),
+    ]
index bc3205556a9068124ad137f642675baabeb0dd13..860eff181fe071d1bdae3e7a349419f8452f6249 100644 (file)
@@ -91,6 +91,13 @@ class Seminar(ClonableMixin, Displayable, ProductCodeMixin, SuggestionsMixin):
     duration        = DurationField(_('approximative duration'))
     professor       = models.ManyToManyField('Professor', related_name='seminar',
                                             verbose_name=_('professor'), blank=True)
+    class TestimonialType(models.TextChoices):
+            ELEARNING = 'elearning', "E-learning"
+            BLENDED = "blended", "Blended"
+    testimonial_type = models.CharField("Type d'attestation", 
+                                        choices=TestimonialType.choices, 
+                                        max_length=10,
+                                        null=True, blank=True)
     docs_description = models.ManyToManyField(Document, related_name="seminar_docs_description",
                                         verbose_name=_('description documents'),
                                         blank=True)
index 1c47a53091201c60ceaef04d9b06891978beac16..2ed864962491f6d51d8481fcfe68f0e53d9e9f2a 100644 (file)
@@ -832,7 +832,7 @@ class TestimonialView(PDFTemplateResponseMixin, SeminarView):
             context['testimonial'] = testimonials[0]
 
         context['blended'] = False
-        if seminar.conference:
+        if seminar.conference and seminar.testimonial_type != seminar.TESTIMONIAL_TYPE.ELEARNING.value:
             if seminar.conference.webclass and seminar.conference in self.request.user.auditor.get().conferences.all():
                 context['blended'] = True
                 context['conference'] = seminar.conference