Skip to content

Commit

Permalink
Changed reading of file to (hopefully) not use absolute path in S3 bu…
Browse files Browse the repository at this point in the history
…ckets
  • Loading branch information
fritzbrand committed Sep 5, 2023
1 parent ab81f4f commit c53ea1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion home/whatsapp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import mimetypes
import os
from pathlib import Path
from urllib.parse import urljoin

Expand Down Expand Up @@ -61,7 +62,7 @@ def get_upload_session_id(image_id):
img_obj = get_image_model().objects.get(id=image_id)
mime_type = mimetypes.guess_type(img_obj.file.name)[0]
file_size = img_obj.file.size
file_path = img_obj.file.path
file_path = os.path.join(settings.MEDIA_ROOT, img_obj.file.name)
data = {
"file_length": file_size,
"file_type": mime_type,
Expand Down

0 comments on commit c53ea1b

Please sign in to comment.