Skip to content

Commit

Permalink
Modified ClearableFileInput in materials/forms.py to comply with newe…
Browse files Browse the repository at this point in the history
…r versions of Django.
  • Loading branch information
uthpalaherath committed Sep 21, 2024
1 parent bc2e864 commit 2fdb6cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion materials/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def __init__(self, model=None, field=None, *args, **kwargs):
class AddReferenceForm(forms.Form):
inputRISFile = forms.FileField(
required=False,
widget=forms.ClearableFileInput(attrs={'multiple': True, 'onchange':'handleFileSelect();' }),
widget=forms.ClearableFileInput(attrs={'allow_multiple_selected': True, 'onchange':'handleFileSelect();' }),
# widget=forms.ClearableFileInput(attrs={'multiple': True, 'onchange':'handleFileSelect();' }),
help_text='Upload RIS file reference'
)
title = forms.CharField(
Expand Down Expand Up @@ -559,6 +560,7 @@ class AddDataForm(forms.Form):
uploaded_files = forms.FileField(
required=False,
widget=forms.ClearableFileInput(attrs={'allow_multiple_selected': True}),
# widget=forms.ClearableFileInput(attrs={'allow_multiple_selected': True}),
help_text=''
'Upload files containing anything that is relevant to the current '
'data (input files to a calculation, image of the sample, ...). '
Expand Down

0 comments on commit 2fdb6cb

Please sign in to comment.