This commit is contained in:
Oliver Walters 2021-03-17 23:15:48 +11:00
parent 8b310d8e47
commit db47629867

View File

@ -22,8 +22,6 @@ from moneyed import CURRENCIES
from PIL import Image from PIL import Image
from urllib.parse import urlsplit
from tempfile import TemporaryFile
import requests import requests
import os import os
import io import io
@ -54,7 +52,6 @@ from InvenTree.views import QRCodeView
from InvenTree.views import InvenTreeRoleMixin from InvenTree.views import InvenTreeRoleMixin
from InvenTree.helpers import DownloadFile, str2bool from InvenTree.helpers import DownloadFile, str2bool
from InvenTree.helpers import TestIfImageURL, TestIfImage
class PartIndex(InvenTreeRoleMixin, ListView): class PartIndex(InvenTreeRoleMixin, ListView):
@ -864,11 +861,6 @@ class PartImageDownloadFromURL(AjaxUpdateView):
# We can now extract a valid URL from the form data # We can now extract a valid URL from the form data
url = form.cleaned_data.get('url', None) url = form.cleaned_data.get('url', None)
# Check that the URL "looks" like an image URL
if not TestIfImageURL(url):
form.add_error('url', _('Supplied URL is not one of the supported image formats'))
return
# Download the file # Download the file
response = requests.get(url, stream=True) response = requests.get(url, stream=True)