]> git.parisson.com Git - teleforma.git/commitdiff
Fix issue with webclass not visible in admin & improve admin filters for correctors
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 30 Jun 2020 13:08:13 +0000 (15:08 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 30 Jun 2020 13:08:13 +0000 (15:08 +0200)
teleforma/admin.py
teleforma/views/crfpa.py
teleforma/webclass/admin.py
teleforma/webclass/models.py

index ae9a3a2c4711bae9eb218da82ecea08796665233..19824b88937c4532da36ace3a8b9de09d23e0b03 100644 (file)
@@ -162,6 +162,7 @@ class CorrectorAdmin(admin.ModelAdmin):
     list_display = ['__unicode__', 'period', 'pay_status',
                     'date_registered']
     actions = ['export_xls']
+    search_fields = ['user__username', 'user__first_name', 'user__last_name', 'user__email']
 
     def export_xls(self, request, queryset):
         book = CorrectorXLSBook(correctors = queryset)
index 7497970a943aebb6ec0fdc1953ca3f898a0ee331..50ddb3b1d3b6bb031ecabf5f3a11d2c2ac174763 100644 (file)
@@ -413,28 +413,31 @@ class CorrectorXLSBook(object):
         row = self.sheet.row(counter + self.first_row)
         row.write(0, user.last_name)
         row.write(1, user.first_name)
-        row.write(2, user.email)
+        row.write(2, user.username)
+        row.write(3, user.email)
 
         profile = Profile.objects.filter(user=user)
         if profile:
             profile = profile[0]
-            row.write(3, profile.address)
-            row.write(4, profile.address_detail)
-            row.write(5, profile.postal_code)
-            row.write(6, profile.city)
-            row.write(7, profile.telephone)
+            row.write(4, profile.address)
+            row.write(5, profile.address_detail)
+            row.write(6, profile.postal_code)
+            row.write(7, profile.city)
+            row.write(8, profile.telephone)
             if profile.birthday:
                 try:
-                    row.write(8, profile.birthday.strftime("%d/%m/%Y"))
+                    row.write(9, profile.birthday.strftime("%d/%m/%Y"))
                 except ValueError:
-                    row.write(8, 'erreur')
+                    row.write(9, 'erreur')
+            row.write(10, profile.birthday_place)
+            row.write(11, profile.ss_number)
 
             if corrector.date_registered:
-                row.write(9, corrector.date_registered.strftime("%d/%m/%Y"))
+                row.write(12, corrector.date_registered.strftime("%d/%m/%Y"))
             else:
-                row.write(9, "")
-            row.write(10, str(corrector.period))
-            row.write(11, corrector.pay_status)
+                row.write(12, "")
+            row.write(13, str(corrector.period))
+            row.write(14, corrector.pay_status)
                 
         return counter + 1
 
@@ -442,6 +445,7 @@ class CorrectorXLSBook(object):
         row = self.sheet.row(0)
         cols = [{'name':'NOM', 'width':5000},
                 {'name':'PRENOM', 'width':5000},
+                {'name':'ID', 'width':5000},
                 {'name':'MAIL', 'width':7500},
                 {'name':'ADRESSE', 'width':7500},
                 {'name':'ADRESSE (suite)', 'width': 7500},
@@ -449,6 +453,8 @@ class CorrectorXLSBook(object):
                 {'name':'VILLE', 'width':5000},
                 {'name':'TEL', 'width':5000},
                 {'name': 'Date de naissance', 'width': 5000},
+                {'name': 'Lieu de naissance', 'width': 5000},
+                {'name': 'Numero SS', 'width': 5000},
                 {'name':"Date inscription", 'width':5000},
                 {'name':"Periode", 'width':5000},
                 {'name':"Statut", 'width':5000},
index 87e9ab5c7bb4e67c45387f4b2591b972e5a256d0..6e69c7bac0f9c623c8e192e2c1dde56572b9d391 100644 (file)
@@ -15,8 +15,8 @@ class WebclassSlotInline(admin.StackedInline):
 
 class WebclassAdmin(admin.ModelAdmin):
     inlines = [WebclassSlotInline]
-    list_filter = ('course', 'period', 'iej')
-    list_display = ('course', 'period')
+    list_filter = ('course', 'period', 'iej', 'bbb_server', 'status')
+    list_display = ('course', 'period', 'bbb_server', 'status')
     filter_horizontal = ('iej',)
     search_fields = ['id', 'course__code', 'course__title']
 
index cacbbf00aec9f2a1ce26a43b99325eda6e03fbb0..c3f059562121038baabc05869c7260f7273bbe24 100644 (file)
@@ -127,8 +127,8 @@ class Webclass(models.Model):
     max_participants        = models.IntegerField('Nombre maxium de participants par créneau', blank=True, null=True, default=80)
     status                  = models.IntegerField(_('status'), choices=STATUS_CHOICES, default=2)
 
-    published = PublishedManager()
     objects = models.Manager()
+    published = PublishedManager()
 
     class Meta(MetaCore):
         db_table = app_label + '_' + 'webclass'
@@ -161,8 +161,8 @@ class WebclassSlot(models.Model):
     room_id         = models.CharField('id de la conférence BBB (généré automatiquement)', blank=True, null=True, max_length=255)
     room_password   = models.CharField('password du modérateur (généré automatiquement)', blank=True, null=True, max_length=255)
 
-    published = SlotPublishedManager()
     objects = models.Manager()
+    published = SlotPublishedManager()
 
     class Meta(MetaCore):
         db_table = app_label + '_' + 'webclass_slot'