From c83c7cb83bc725fd6ac093454de4e9fb19490266 Mon Sep 17 00:00:00 2001 From: Jenny Qian Date: Tue, 14 Feb 2017 17:34:05 -0600 Subject: [PATCH] add the option to allow .mp3 files upload --- tendenci/apps/files/utils.py | 3 +++ tendenci/settings.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/tendenci/apps/files/utils.py b/tendenci/apps/files/utils.py index 49ae0a8c2e..245a7ae385 100644 --- a/tendenci/apps/files/utils.py +++ b/tendenci/apps/files/utils.py @@ -526,6 +526,9 @@ def get_allowed_upload_file_exts(file_type='other'): 'video': ('.wmv', '.mov', '.mpg', '.mp4', '.m4v'), 'other': ('.txt','.doc', '.docx', '.csv', '.xls', '.xlsx', '.ppt', '.pptx', '.pps', '.ppsx', '.pdf', '.zip'), } + if settings.ALLOW_MP3_UPLOAD: + types['other'] += ('.mp3',) + if file_type in ['image', 'video']: return types[file_type] diff --git a/tendenci/settings.py b/tendenci/settings.py index 74d180e68b..8ff43d9a73 100644 --- a/tendenci/settings.py +++ b/tendenci/settings.py @@ -564,3 +564,9 @@ # -------------------------------------- # GAVATAR_DEFAULT_SIZE = 80 GAVATAR_DEFAULT_URL = 'images/icons/default-user-80.jpg' + +# ------------------------------------------------- # +# Allow .mp3 files to be uploaded - default to False +# ------------------------------------------------- # +ALLOW_MP3_UPLOAD = False +