Skip to content
Snippets Groups Projects
Commit 5507c65e authored by Andreas Hubel's avatar Andreas Hubel Committed by Roang
Browse files

fix(scheduleimport): use ContentFile instead of BytesIO

parent f3284da4
No related branches found
No related tags found
No related merge requests found
...@@ -6,13 +6,13 @@ import subprocess ...@@ -6,13 +6,13 @@ import subprocess
import tempfile import tempfile
import uuid import uuid
from datetime import UTC, datetime, timedelta from datetime import UTC, datetime, timedelta
from io import BytesIO
from pathlib import Path from pathlib import Path
from string import ascii_letters, digits from string import ascii_letters, digits
from urllib.parse import parse_qs, urlparse, urlunparse from urllib.parse import parse_qs, urlparse, urlunparse
import requests import requests
from django.core.files.base import ContentFile
from django.urls import NoReverseMatch from django.urls import NoReverseMatch
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils.html import strip_tags from django.utils.html import strip_tags
...@@ -217,7 +217,7 @@ def download_from_url(url: str) -> tuple[str, bytes]: ...@@ -217,7 +217,7 @@ def download_from_url(url: str) -> tuple[str, bytes]:
# read the binary content # read the binary content
r.raw.decode_content = True r.raw.decode_content = True
data = BytesIO(r.content) data = ContentFile(r.content)
# return the result # return the result
return filename, data return filename, data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment