summaryrefslogtreecommitdiff
path: root/archaeological_operations/views.py
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2022-01-31 17:08:43 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:21:00 +0100
commitbf0c1161182e905b44a4cb1f17afc9b1f08414c3 (patch)
treee11fd33830173c1a9bcfe8668ad1cff734dbd1c6 /archaeological_operations/views.py
parentf14c72ff4ed319ba26f9e7111eac7a01f959359e (diff)
downloadIshtar-bf0c1161182e905b44a4cb1f17afc9b1f08414c3.tar.bz2
Ishtar-bf0c1161182e905b44a4cb1f17afc9b1f08414c3.zip
Operation - Parcels - Modify: trying to pass TOWNS data on post request #5227
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r--archaeological_operations/views.py10
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