]> git.parisson.com Git - teleforma.git/commitdiff
stick actions in admin, fix media mime type, fix args in conference import command
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 23 Jun 2021 05:06:04 +0000 (07:06 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Wed, 23 Jun 2021 05:06:04 +0000 (07:06 +0200)
app/settings.py
teleforma/management/commands/teleforma-import-conferences-2.py
teleforma/models/core.py

index 51dc06388208f38a62c1515890f343fafeaee2f4..f4929aa5ba323f1917f85757eb40ae6488a1f0ca 100644 (file)
@@ -466,7 +466,7 @@ JAZZMIN_UI_TWEAKS = {
     "sidebar_nav_small_text": True,
     "sidebar_disable_expand": False,
     "sidebar_nav_child_indent": False,
-    "sidebar_nav_compact_style": False,
+    "sidebar_nav_compact_style": True,
     "sidebar_nav_legacy_style": False,
     "sidebar_nav_flat_style": False,
     "theme": "default",
@@ -479,7 +479,7 @@ JAZZMIN_UI_TWEAKS = {
         "danger": "btn-outline-danger",
         "success": "btn-outline-success"
     },
-    "actions_sticky_top": False
+    "actions_sticky_top": True
 }
 # Sherlock's online payment
 PAYMENT_SHERLOCKS_PATH='/srv/sherlocks'
index 34d511faa3bf25b27bdc343b258cb949360c0a75..54dcdcb8295937ce31f531cefdf8e53b0219e9dc 100644 (file)
@@ -29,6 +29,9 @@ class Command(BaseCommand):
     transcoded_formats = ['mp4', 'ogg', 'mp3']
     image_formats = ['png', 'jpg']
 
+    def add_arguments(self, parser):
+        parser.add_argument('args', nargs='*')
+
     def handle(self, *args, **options):
         organization_name = args[0]
         department_name = args[1]
@@ -87,6 +90,7 @@ class Command(BaseCommand):
                             media.period = conference.period
                             media.course_type = conference.course_type
                             media.type = ext
+                            media.is_published = False
                             media.set_mime_type()
 
                             files = os.listdir(root)
index 1586dcec3633f370517351ea08cae1dd8a6fc191..dfe40884b057d6f24182689bb5a4b2a670227f05 100755 (executable)
@@ -799,7 +799,7 @@ class Media(MediaBase):
         _('poster file'), upload_to='items/%Y/%m/%d', max_length=255, null=True, blank=False)
 
     def set_mime_type(self):
-        if self.item.file:
+        if self.file:
             mime_type = guess_mimetypes(self.file.path)
             if mime_type == 'audio/mpeg':
                 self.mime_type = 'audio/mp3'