Fix many-to-many field saving for Django 2.1
This commit is contained in:
parent
e1ff5b64cf
commit
b240a110b3
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user