summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_operations/tests.py7
-rw-r--r--archaeological_operations/views.py23
2 files changed, 1 insertions, 29 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 5d41d0202..84b684410 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -1670,14 +1670,7 @@ class ParcelTest(ImportTest, TestCase):
response = c.get(reverse("operation-parcels-modify", kwargs={"pk": operation.pk}))
self.assertEqual(response.status_code, 200)
- print(response)
- self.assertInHTML(
- '<select id="id_form-0-town" class="form-control" name="form-0-town"><select>',
- town_1.name,
- count=1
- )
self.assertContains(response, town_1.name)
- print(response)
self.assertContains(response, town_2.name)
self.assertContains(response, parcel_1.year)
self.assertContains(response, parcel_2.year)
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index da46d9e17..a40f8f9ef 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -421,7 +421,7 @@ def operation_modify_parcels(request, pk):
if request.method == 'POST': #TODO
print(request.POST)
- # formset = formset_class(request.POST or None, request.FILES or None)
+ formset = formset_class(request.POST or None, request.FILES or None)
if formset.is_valid():
print(formset.cleaned_data)
post_data = request.POST.copy()
@@ -465,27 +465,6 @@ def operation_modify_parcels(request, pk):
})
-# class ParcelFormView(QAItemForm):
-# template_name = 'ishtar/forms/operation_modify_parcels.html'
-# form_class = SelectedParcelFormSet
-# base_url = "operation-parcels-modify"
-# model = models.Operation
-#
-# def get_form_kwargs(self):
-# kwargs = super(ParcelFormView, self).get_form_kwargs()
-# kwargs["user"] = self.request.user
-# return kwargs
-#
-# def form_valid(self, form):
-# form.save()
-# return HttpResponseRedirect(reverse("success"))
-#
-# def get_context_data(self, **kwargs):
-# data = super(ParcelFormView, self).get_context_data(**kwargs)
-# data["action_name"] = _("Modify parcels")
-# return data
-
-
# archaeological sites