]> git.parisson.com Git - teleforma.git/commitdiff
Add mode to appointments https://trackers.pilotsystems.net/probarreau/0894
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 14 Sep 2020 08:33:22 +0000 (10:33 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 14 Sep 2020 08:33:22 +0000 (10:33 +0200)
teleforma/admin.py
teleforma/views/appointment.py

index ca3c64ff4c11023c6179d411245cbf7fa8090fbf..c8ae9b7a9ebfe71e8b6d55c204ca1f906608102a 100644 (file)
@@ -317,7 +317,7 @@ class AppointmentJuryAdmin(admin.ModelAdmin):
 
 class AppointmentAdmin(admin.ModelAdmin):
     list_display = ('real_date', 'student', 'jury')
-    list_filter = ('slot__date', 'slot__appointment_period')
+    list_filter = ('slot__date', 'slot__appointment_period', 'slot__mode')
     actions = ['export_csv']
 
     def export_csv(self, request, queryset):
@@ -325,7 +325,7 @@ class AppointmentAdmin(admin.ModelAdmin):
         response['Content-Disposition'] = 'attachment; filename=rendezvous.csv'
         writer = csv.writer(response)
 
-        writer.writerow(['date', 'creneau', 'nom', 'prenom', 'email', 'iej', 'jury'])
+        writer.writerow(['date', 'creneau', 'nom', 'prenom', 'email', 'iej', 'jury', 'mode'])
         def csv_encode(item):
             if isinstance(item, unicode):
                 return item.encode('utf-8')
@@ -336,7 +336,7 @@ class AppointmentAdmin(admin.ModelAdmin):
             user = app.student
             student = user.student.all()[0]
 
-            row = [ app.day.strftime('%d/%m/%Y'), app.start, user.last_name, user.first_name, user.email, student.iej, app.jury.name ]
+            row = [ app.day.strftime('%d/%m/%Y'), app.start, user.last_name, user.first_name, user.email, student.iej, app.jury.name, app.slot.mode ]
             row = [ csv_encode(col) for col in row ]
 
             writer.writerow(row)
index 983dab7405207c91ef6cd33613f79a2fc66227c6..afa9f8455270b009da7f57bc7c7245844906866e 100644 (file)
@@ -134,9 +134,8 @@ class Appointments(View):
                  'bbb': ap.appointment_period.bbb_room,
                  'main_text': main_text }
         # DEBUG
-        data['mto'] = "yoanl@pilotsystems.net"
+        data['mto'] = "yoanl@pilotsystems.net"
         # data['mto'] = "dorothee.lavalle@pre-barreau.com"
-        # data['mto'] = "gael@pilotsystems.net"
 
         subject_template = 'teleforma/messages/email_appointment_sujet.txt'
         message_template = 'teleforma/messages/email_appointment.txt'