summaryrefslogtreecommitdiff
path: root/archaeological_finds/forms_treatments.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-06-03 22:24:12 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-06-03 22:24:12 +0200
commit347bd90a73d4c8aa3066d4c0d98c2b59598dadef (patch)
tree429fef4cdf9018a117b878a6e371382fb79ffadb /archaeological_finds/forms_treatments.py
parent4362be17552347022e77c878a0046716847bfd15 (diff)
downloadIshtar-347bd90a73d4c8aa3066d4c0d98c2b59598dadef.tar.bz2
Ishtar-347bd90a73d4c8aa3066d4c0d98c2b59598dadef.zip
QAPackaging: fix treatment type filter
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
-rw-r--r--archaeological_finds/forms_treatments.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py
index 6c22b30ee..907ea17b4 100644
--- a/archaeological_finds/forms_treatments.py
+++ b/archaeological_finds/forms_treatments.py
@@ -460,7 +460,6 @@ class QAFindTreatmentForm(IshtarForm):
for tt in tt_change_ref_loca
)
-
tt_change_current_loca = list(
models.TreatmentType.objects.filter(
available=True, change_current_location=True).all())
@@ -470,8 +469,10 @@ class QAFindTreatmentForm(IshtarForm):
for tt in tt_change_current_loca
)
- self.treatment_type_all_choices = self.treatment_type_ref_choices + \
- self.treatment_type_current_choices
+ self.treatment_type_all_choices = "".join(
+ "<option value='{}'>{}</option>".format(tt.pk, str(tt))
+ for tt in set(tt_change_current_loca + tt_change_ref_loca)
+ )
super(QAFindTreatmentForm, self).__init__(*args, **kwargs)
if not self.user:
@@ -479,7 +480,7 @@ class QAFindTreatmentForm(IshtarForm):
# treatment type is dynamic put all for check
self.fields['treatment_type'].choices = [
- (tt.pk, str(tt)) for tt in (
+ (tt.pk, str(tt)) for tt in set(
tt_change_ref_loca + tt_change_current_loca)
]