summaryrefslogtreecommitdiff
path: root/archaeological_operations/views.py
diff options
context:
space:
mode:
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