summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-12-17 11:38:49 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:20:59 +0100
commit9a933515d0a263a077b96cf2a0517f6e6b2be314 (patch)
treef1b5b051487152744002d1ca512507f56e54481f /archaeological_finds
parent97e8942616164eb4df936f97307cbb5c2121d702 (diff)
downloadIshtar-9a933515d0a263a077b96cf2a0517f6e6b2be314.tar.bz2
Ishtar-9a933515d0a263a077b96cf2a0517f6e6b2be314.zip
Find - Quick action n1 treatment: add redirect in table quick action - fix resulting_pk initialization (refs #5231)
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models_finds.py1
-rw-r--r--archaeological_finds/views.py29
2 files changed, 14 insertions, 16 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 94c3b97b4..1672a9c3c 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -1712,6 +1712,7 @@ class Find(
text=_("Treatment many to one"),
target="many",
rights=["change_find", "change_own_find"],
+ is_popup=False,
),
QA_LOCK,
]
diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py
index d04a15c67..4def2e14b 100644
--- a/archaeological_finds/views.py
+++ b/archaeological_finds/views.py
@@ -353,10 +353,7 @@ find_creation_wizard = wizards.FindWizard.as_view(
def find_create(request, pk):
context_record = wizard_is_available(
- find_creation_wizard,
- request,
- ContextRecord,
- pk
+ find_creation_wizard, request, ContextRecord, pk
)
if not context_record:
return HttpResponseRedirect("/")
@@ -656,18 +653,24 @@ treatment_creation_n1_wizard = wizards.TreatmentN1Wizard.as_view(
def treatment_n1_create(request, pks):
- for pk in pks.split("-"):
- if not wizard_is_available(treatment_creation_n1_wizard, request, models.Find, pk):
+ pks = pks.split("-")
+ for pk in pks:
+ if not wizard_is_available(
+ treatment_creation_n1_wizard, request, models.Find, pk
+ ):
return HttpResponseRedirect("/")
wizards.TreatmentN1Wizard.session_set_value(
- request, "selecfind-treatment_creation_n1", "pk", pks, reset=True
+ request,
+ "selecfind-treatment_creation_n1",
+ "resulting_pk",
+ ",".join(pks),
+ reset=True,
)
return redirect(
- reverse(
- "treatment_creation_n1", kwargs={"step": "file-treatment_creation_n1"}
- )
+ reverse("treatment_creation_n1", kwargs={"step": "file-treatment_creation_n1"})
)
+
treatment_1n_wizard_steps = [
("selecfind-treatment_creation_1n", forms.SingleUpstreamFindFormSelection),
("file-treatment_creation_1n", forms.TreatmentFormFileChoice),
@@ -1321,12 +1324,6 @@ class QAFindLockView(QABaseLockView):
base_url = "find-qa-lock"
-class QAFindTreatmentN1View(QAItemForm):
- model = models.Treatment
- form_class = forms.QAFindTreatmentN1Form
- base_url = "find-qa-treatmentN1"
-
-
def get_geo_items(request, get_polygons, current_right=None):
operation_pk = request.GET.get("operation_pk")
context_record_pk = request.GET.get("context_record_pk")