Skip to content

Commit

Permalink
Fix ClearableFileInput (subclass according to django docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Dec 18, 2023
1 parent 466d61a commit 8dbc8c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/ingest/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
from django.forms import ClearableFileInput
from .models import Bulk


class MultipleFileInput(forms.ClearableFileInput):
allow_multiple_selected = True


class BulkVolumeUploadForm(forms.ModelForm):
class Meta:
model = Bulk
fields = ['image_server', 'volume_files', 'collections']
fields = ["image_server", "volume_files", "collections"]
widgets = {
'volume_files': ClearableFileInput(attrs={'allow_multiple_selected': True, 'multiple': True}),
"volume_files": MultipleFileInput,
}

0 comments on commit 8dbc8c2

Please sign in to comment.