Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add the option to allow .mp3 files upload
  • Loading branch information
jennyq committed Feb 14, 2017
1 parent c493d64 commit c83c7cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tendenci/apps/files/utils.py
Expand Up @@ -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]

Expand Down
6 changes: 6 additions & 0 deletions tendenci/settings.py
Expand Up @@ -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

0 comments on commit c83c7cb

Please sign in to comment.