summaryrefslogtreecommitdiff
path: root/app/media/models.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-05-07 14:17:05 -0400
committerluxagraf <sng@luxagraf.net>2023-05-07 14:17:05 -0400
commitecf5763d392d63b7efe1fd4f906e11281f5438a2 (patch)
tree6ad1ce99dd43577a192f35a5d8bf9d552c4664b4 /app/media/models.py
parent9bb9db0bf8e82b5fc2b09b8cf58454a2d6240929 (diff)
media: fixed upload bug even though it doesn't work
Diffstat (limited to 'app/media/models.py')
-rw-r--r--app/media/models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/media/models.py b/app/media/models.py
index c93b9fc..64f427a 100644
--- a/app/media/models.py
+++ b/app/media/models.py
@@ -5,6 +5,7 @@ from pathlib import Path
from PIL import Image
from django.core.exceptions import ValidationError
+from django.core.files import File
from django.contrib.gis.db import models
from django.contrib.sitemaps import Sitemap
from django.db.models.signals import post_save
@@ -26,17 +27,17 @@ from .utils import resize_image
from locations.models import Location, CheckIn
-def add_mp4(self, filepath, luxvideo):
+def add_mp4(filepath, luxvideo):
full_filepath = "/home/lxf/sites/django/luxagraf.net/"+filepath
- v = open(filepath, "rb")
+ v = open(full_filepath, "rb")
django_file = File(v)
video = LuxVideo.objects.get(title=luxvideo)
video.video_mp4.save(filepath, django_file, save=True)
-def add_webm(self, filepath, luxvideo):
+def add_webm(filepath, luxvideo):
full_filepath = "/home/lxf/sites/django/luxagraf.net/"+filepath
- v = open(filepath, "rb")
+ v = open(full_filepath, "rb")
django_file = File(v)
video = LuxVideo.objects.get(title=luxvideo)
video.video_webm.save(filepath, django_file, save=True)