diff --git a/lostplaces/lostplaces_app/forms.py b/lostplaces/lostplaces_app/forms.py index 38120ed..e3d61f6 100644 --- a/lostplaces/lostplaces_app/forms.py +++ b/lostplaces/lostplaces_app/forms.py @@ -25,8 +25,8 @@ class PlaceImageCreateForm(forms.ModelForm): fields = '__all__' exclude = ['submitted_by', 'place', 'description'] widgets = { - 'filename': forms.ClearableFileInput(attrs={'multiple': True}), - }, + 'filename': forms.ClearableFileInput(attrs={'multiple': True}) + } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index b2c8c63..2bb5685 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -51,9 +51,9 @@ class PlaceEditView(View): if request.FILES: self._apply_multipart_image_upload( - request.FILES.getlist('filename'), - place, - submitter + files=request.FILES.getlist('filename'), + place=place, + submitter=submitter ) kwargs_to_pass = { @@ -67,6 +67,7 @@ class PlaceEditView(View): return render(request, 'create_place.html', context) def _apply_multipart_image_upload(self, files, place, submitter): + print(files) for image in files: place_image = PlaceImage.objects.create( filename=image,