Fix many-to-many field saving for Django 2.1

This commit is contained in:
Anna Sidwell 2018-12-02 00:30:38 +00:00
parent e1ff5b64cf
commit b240a110b3

View File

@ -75,18 +75,18 @@ class BaseForm(LoginRequiredMixin, CreateView):
self.object = form.save()
self.object.official_project_documents = form.cleaned_data.get(
self.object.official_project_documents.set(form.cleaned_data.get(
'official_project_documents_files', []
)
self.object.other_documents = form.cleaned_data.get(
))
self.object.other_documents.set(form.cleaned_data.get(
'other_documents_files', []
)
self.object.shapefiles = form.cleaned_data.get(
))
self.object.shapefiles.set(form.cleaned_data.get(
'shapefiles_files', []
)
self.object.images = form.cleaned_data.get(
))
self.object.images.set(form.cleaned_data.get(
'images_files', []
)
))
self.object.author = self.request.user
self.object.save()