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 | e567db44b5aa79767a919de1756ebc6bed4ab91b (patch) | |
| tree | e11fd33830173c1a9bcfe8668ad1cff734dbd1c6 | |
| parent | 6638d589c9578a751591b51dec88afa4add1dc0a (diff) | |
| download | Ishtar-e567db44b5aa79767a919de1756ebc6bed4ab91b.tar.bz2 Ishtar-e567db44b5aa79767a919de1756ebc6bed4ab91b.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 |
