diff options
author | Cefin <kevon@tuta.io> | 2022-01-31 17:08:43 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:21:00 +0100 |
commit | bf0c1161182e905b44a4cb1f17afc9b1f08414c3 (patch) | |
tree | e11fd33830173c1a9bcfe8668ad1cff734dbd1c6 | |
parent | f14c72ff4ed319ba26f9e7111eac7a01f959359e (diff) | |
download | Ishtar-bf0c1161182e905b44a4cb1f17afc9b1f08414c3.tar.bz2 Ishtar-bf0c1161182e905b44a4cb1f17afc9b1f08414c3.zip |
Operation - Parcels - Modify: trying to pass TOWNS data on post request #5227
-rw-r--r-- | archaeological_operations/views.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 2a8207375..faf73826e 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -422,8 +422,14 @@ def operation_modify_parcels(request, pk): if request.method == 'POST': - data = {'TOWNS': available_towns} - formset = formset_class(request.POST, request.FILES, data=data) #DON'T WORK THAT WAY + data = { + 'TOWNS': available_towns, + 'form-TOTAL_FORMS': 1, + 'form-INITIAL_FORMS': 0, + } + request_to_update = request.POST.copy() + + formset = formset_class(request_to_update.update({'TOWNS': available_towns}), request.FILES) #DON'T WORK THAT WAY for form in formset: #DEBUG print(form.errors) #DEBUG |