Prevent filename from beginning with /
This commit is contained in:
1 parent
bc6f209d8d
commit
c2b21c016e
1 file changed
+2
-1
@@ -1276,7 +1276,8 @@ class Media(models.Model):
|
||||
# Create a suitable filename from the source media_format
|
||||
media_format = str(self.source.media_format)
|
||||
media_details = self.format_dict
|
||||
return media_format.format(**media_details)
|
||||
result = media_format.format(**media_details)
|
||||
return '.' + result if '/' == result[0] else result
|
||||
|
||||
@property
|
||||
def directory_path(self):
|
||||
|
||||
Reference in new issue
Block a user