From 03ab1c9b4f2e6ca643c15cd4dbaf49ef686d904a Mon Sep 17 00:00:00 2001 From: HSZemi Date: Sat, 5 Aug 2023 00:01:35 +0200 Subject: [PATCH] Update requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Django 4.1.3 → 4.2.4 --- development.txt | 2 +- mapsapp/forms.py | 24 ++++++++++++++++++++---- requirements.txt | 44 ++++++++++++++++++++++---------------------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/development.txt b/development.txt index 600b6eb..6d881f0 100644 --- a/development.txt +++ b/development.txt @@ -1 +1 @@ -selenium==3.141.0 +selenium==4.11.2 diff --git a/mapsapp/forms.py b/mapsapp/forms.py index ea39233..cc3250c 100644 --- a/mapsapp/forms.py +++ b/mapsapp/forms.py @@ -57,6 +57,24 @@ FORM_HELP_IMAGES_TO_COPY = "Select the image files you want to copy to your new map." +class MultipleFileInput(forms.ClearableFileInput): + allow_multiple_selected = True + + +class MultipleFileField(forms.FileField): + def __init__(self, *args, **kwargs): + kwargs.setdefault("widget", MultipleFileInput()) + super().__init__(*args, **kwargs) + + def clean(self, data, initial=None): + single_file_clean = super().clean + if isinstance(data, (list, tuple)): + result = [single_file_clean(d, initial) for d in data] + else: + result = single_file_clean(data, initial) + return result + + def get_version_tag_choices(): versiontags = [] try: @@ -71,8 +89,7 @@ class NewRmsForm(forms.Form): file = forms.FileField(validators=[FileExtensionValidator(allowed_extensions=['rms'])], help_text=FORM_HELP_FILE) - images = forms.FileField(widget=forms.FileInput(attrs={'multiple': True}), - required=False, + images = MultipleFileField(required=False, help_text=FORM_HELP_IMAGES) name = forms.CharField(max_length=255, @@ -138,8 +155,7 @@ class EditRmsForm(ModelForm): required=False, widget=CheckboxSelectMultiple) - images = forms.FileField(widget=forms.FileInput(attrs={'multiple': True}), - required=False, + images = MultipleFileField(required=False, label='Add images') class Meta: diff --git a/requirements.txt b/requirements.txt index 136644a..1e7eff8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,52 +1,52 @@ adal==1.2.7 appdirs==1.4.4 -asgiref==3.5.2 +asgiref==3.7.2 asn1crypto==1.5.1 azure-common==1.1.28 -azure-core==1.26.1 -azure-storage-blob==12.14.1 +azure-core==1.28.0 +azure-storage-blob==12.17.0 azure-storage-common==2.1.0 -CacheControl==0.12.11 -certifi==2022.9.24 +CacheControl==0.13.1 +certifi==2023.7.22 cffi==1.15.1 -chardet==5.1.0 -charset-normalizer==2.1.1 -click==8.1.3 +chardet==5.2.0 +charset-normalizer==3.2.0 +click==8.1.6 colorama==0.4.6 contextlib2==21.6.0 -cryptography==38.0.4 -distlib==0.3.6 +cryptography==41.0.3 +distlib==0.3.7 distro==1.8.0 -Django==4.1.3 -django-storages==1.13.1 +Django==4.2.4 +django-storages==1.13.2 django-widget-tweaks==1.4.12 html5lib==1.1 idna==3.4 ipaddr==2.2.0 isodate==0.6.1 lockfile==0.12.2 -msgpack==1.0.4 +msgpack==1.0.5 msrest==0.7.1 msrestazure==0.6.4 oauthlib==3.2.2 -packaging==21.3 +packaging==23.1 pep517==0.13.0 -Pillow==9.3.0 +Pillow==10.0.0 progress==1.6 pycparser==2.21 -PyJWT==2.6.0 -pyparsing==3.0.9 +PyJWT==2.8.0 +pyparsing==3.1.1 python-dateutil==2.8.2 pytoml==0.1.21 -pytz==2022.6 -requests==2.28.1 +pytz==2023.3 +requests==2.31.0 requests-oauthlib==1.3.1 retrying==1.3.4 six==1.16.0 -sqlparse==0.4.3 +sqlparse==0.4.4 toml==0.10.2 tomli==2.0.1 -typing_extensions==4.4.0 -urllib3==1.26.13 +typing_extensions==4.7.1 +urllib3==1.26.16 uuid==1.30 webencodings==0.5.1