From: Guillaume Pellerin Date: Wed, 23 Jun 2021 05:06:04 +0000 (+0200) Subject: stick actions in admin, fix media mime type, fix args in conference import command X-Git-Tag: 2.1~66^2^2~10 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=976b5b9971ad3e6266d0fa8c75dac6f14fe12a61;p=teleforma.git stick actions in admin, fix media mime type, fix args in conference import command --- diff --git a/app/settings.py b/app/settings.py index 51dc0638..f4929aa5 100644 --- a/app/settings.py +++ b/app/settings.py @@ -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' diff --git a/teleforma/management/commands/teleforma-import-conferences-2.py b/teleforma/management/commands/teleforma-import-conferences-2.py index 34d511fa..54dcdcb8 100644 --- a/teleforma/management/commands/teleforma-import-conferences-2.py +++ b/teleforma/management/commands/teleforma-import-conferences-2.py @@ -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) diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 1586dcec..dfe40884 100755 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -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'