Merge pull request #853 from tcely/patch-20
Prevent `filename` from beginning with `/`
This commit is contained in:
1 file changed
+2
-1
@@ -1276,7 +1276,8 @@ class Media(models.Model):
|
|||||||
# Create a suitable filename from the source media_format
|
# Create a suitable filename from the source media_format
|
||||||
media_format = str(self.source.media_format)
|
media_format = str(self.source.media_format)
|
||||||
media_details = self.format_dict
|
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
|
@property
|
||||||
def directory_path(self):
|
def directory_path(self):
|
||||||
|
|||||||
Reference in new issue
Block a user