mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 05:59:55 +02:00
Fix #473: ".None" extension when downloading Flac file
This commit is contained in:
parent
742ee9bc9b
commit
837d6ad0e1
4 changed files with 22 additions and 2 deletions
|
@ -688,6 +688,10 @@ class Upload(models.Model):
|
|||
|
||||
@property
|
||||
def extension(self):
|
||||
try:
|
||||
return utils.MIMETYPE_TO_EXTENSION[self.mimetype]
|
||||
except KeyError:
|
||||
pass
|
||||
if not self.audio_file:
|
||||
return
|
||||
return os.path.splitext(self.audio_file.name)[-1].replace(".", "", 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue