InvenTree/InvenTree/common
bloemp e1d1b51936
Various fixes to the "Download image from URL" functionality (#4101)
* Various fixes to the "Download image from URL" functionality

This commit adds an user-agent string to the download request wich prevents some sites from
returning a 403 (forbidden) status.
Clicking the download button on the thumbnail, also showed the thumbnail because the event wasn't stopped.
The parts thumbnail didn't update after a succesfull download of the image, reloadImage was never called.

* Fixed copy and paste errors in previous commit

* Reverted back the user-agent  immitation from the previous commit

* Add a user-agent overide setting

Add a setting to allow overiding the default user-agent  that is used for downloading images and files from a URL

* Fixed a typo in the description

* Another typo fixed

* Removed cast to string to prevent using 'None' as the user-agent

* Thumbnail delete button not visible after upload

The delete button on the image thumbnails of both parts and companies
isn't showing when we upload a new image. This is fixed by always
including the element on the page, and use javascript to show and hide
the element.
2022-12-24 23:17:04 +11:00
..
fixtures fix endline 2022-05-20 13:35:07 +02:00
migrations Add news reader (#3445) 2022-11-10 12:20:06 +11:00
__init__.py startapp common 2019-09-03 08:30:14 +10:00
admin.py Add news reader (#3445) 2022-11-10 12:20:06 +11:00
api.py Notification fix (#3939) 2022-11-17 08:26:19 +11:00
apps.py Prevent write of SERVER_RESTART_REQUIRED setting when importing dataset (#3249) 2022-06-24 20:42:55 +10:00
files.py Add more checks to pre-commit (#3132) 2022-06-06 08:56:52 +10:00
forms.py Remove SettingEditForm (#3964) 2022-11-19 23:10:02 +11:00
models.py Various fixes to the "Download image from URL" functionality (#4101) 2022-12-24 23:17:04 +11:00
notifications.py Part pricing cache (#3710) 2022-11-14 15:58:22 +11:00
serializers.py Notification fix (#3939) 2022-11-17 08:26:19 +11:00
settings.py Setting caching (#3178) 2022-06-12 10:56:16 +10:00
tasks.py Improvements for docker / gunicorn (#4031) 2022-12-08 23:06:02 +11:00
test_notifications.py Adds callback for creation of an error log (#3136) 2022-06-06 15:21:31 +10:00
test_tasks.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
test_views.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
tests.py Fix email notification setting (#3832) 2022-10-22 18:56:38 +11:00
urls.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
views.py Switch to pathlib (#3392) 2022-07-27 10:42:34 +10:00