|
14 | 14 |
|
15 | 15 | from django.core.files.storage import FileSystemStorage
|
16 | 16 | from django.contrib.auth import models as authmodels
|
| 17 | +from django.utils.encoding import escape_uri_path |
17 | 18 | from signbank.settings.base import WRITABLE_FOLDER, GLOSS_VIDEO_DIRECTORY, GLOSS_IMAGE_DIRECTORY, FFMPEG_PROGRAM
|
18 | 19 | # from django.contrib.auth.models import User
|
19 | 20 | from datetime import datetime
|
@@ -913,7 +914,7 @@ def add_descriptions(self, descriptions):
|
913 | 914 | def get_video_path(self):
|
914 | 915 | if settings.DEBUG_VIDEOS:
|
915 | 916 | print('get_video_path GlossVideoNME: ', str(self.videofile))
|
916 |
| - return self.videofile.name |
| 917 | + return escape_uri_path(self.videofile.name) if self.videofile else '' |
917 | 918 |
|
918 | 919 | def ensure_mp4(self):
|
919 | 920 | """Ensure that the video file is an h264 format
|
@@ -987,7 +988,7 @@ class Meta:
|
987 | 988 | ordering = ['perspective', ]
|
988 | 989 |
|
989 | 990 | def get_video_path(self):
|
990 |
| - return self.videofile.name |
| 991 | + return escape_uri_path(self.videofile.name) if self.videofile else '' |
991 | 992 |
|
992 | 993 | def save(self, *args, **kwargs):
|
993 | 994 | super(GlossVideoPerspective, self).save(*args, **kwargs)
|
|
0 commit comments