Use the media_file storage location

This should be the same, but this way works outside of this file too.
This commit is contained in:
tcely authored and GitHub committed 2024-12-23 19:31:38 -05:00
1 parent 2ee635118b
commit f7b36a47da
1 file changed
+1 -1
+1 -1
View File
@@ -1547,7 +1547,7 @@ class Media(models.Model):
new_video_path = new_video_path.resolve(strict=True) new_video_path = new_video_path.resolve(strict=True)
# update the media_file in the db # update the media_file in the db
self.media_file.name = str(new_video_path.relative_to(media_file_storage.location)) self.media_file.name = str(new_video_path.relative_to(self.media_file.storage.location))
self.save(update_fields={'media_file'}) self.save(update_fields={'media_file'})
self.refresh_from_db(fields={'media_file'}) self.refresh_from_db(fields={'media_file'})
log.info(f'Updated "media_file" in the database for: {self!s}') log.info(f'Updated "media_file" in the database for: {self!s}')