Merge pull request #853 from tcely/patch-20

Prevent `filename` from beginning with `/`
This commit is contained in:
meeb authored and GitHub committed 2025-03-17 15:24:58 +11:00
commit c4574fd2b2
1 file changed
+2 -1
+2 -1
View File
@@ -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):